-->
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: Join Select
PostPosted: Wed Sep 12, 2007 2:28 pm 
Newbie

Joined: Tue Sep 11, 2007 2:34 pm
Posts: 5
Hi,

What would be the easiest way to implement the following select statement :

" select A.FIELD1, B.FIELD2
from TABLE1 A, TABLE2 B
where A.ID = B.ID "

I have TABLE1 mapped to class T1, and TABLE2 mapped to class T2.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 14, 2007 11:44 am 
Newbie

Joined: Tue Sep 04, 2007 2:21 pm
Posts: 14
HQL

from class1 a
inner join a.class2

HTH
Tom


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 14, 2007 1:45 pm 
Newbie

Joined: Tue Sep 11, 2007 2:34 pm
Posts: 5
[i][quote="TomAtoms"]HQL

from class1 a
inner join a.class2

HTH
Tom[/quote][/i]


thanks! Do I have to create associations in class A mapping file, something like <one-to-one> or <one-to-many> ?


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.