-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: how to display result when using joint hql statement
PostPosted: Fri Jan 21, 2005 1:46 am 
Newbie

Joined: Tue Jan 11, 2005 4:34 am
Posts: 18
Read the rules before posting!
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version: 2.1.7c

i have 2 tables, namely names and email. i want to join them in a way it will have the result of 2 fields which is firstname and email.
but after i execute the code i get [LJava.lang.Object;@df1832

so how actually do you display this kind of situation wherein you will select only 2 column from a table..

this is part of my codes
...
query = "SELECT n.FirstName,e.Email FROM Names n, Email e WHERE n.contact_id = e.contact_id";

try {
Configuration cfg = new Configuration().addClass(Address.class).addClass(Company.class).addClass(Email.class).addClass(Names.class).addClass(Tel.class);
SessionFactory sf = cfg.buildSessionFactory();
Session s = sf.openSession();

Vector v = new Vector();
v.add(s.find(query));
System.out.println(v.elementAt(0).toString());
...

tnkx


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 21, 2005 4:18 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
Please read http://www.hibernate.org/hib_docs/refer ... larqueries


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jan 21, 2005 4:38 am 
Newbie

Joined: Tue Jan 11, 2005 4:34 am
Posts: 18
so this is how it should be used....
tnkx a lot~


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.