-->
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.  [ 2 posts ] 
Author Message
 Post subject: Joins - (newbie question)
PostPosted: Mon Nov 07, 2005 12:14 am 
Newbie

Joined: Sun Nov 06, 2005 11:53 pm
Posts: 1
Hi,
If I have OrderLines and Product table (Product.class) for the following classes and only the specified attributes are declared in the hibernate mapping, can I create a query like
"select qty, productName from OrderLine, Product where Product.pruductId = 10" without declaring any Collection attribute in any of the classes? I've seen in the reference something like "select new list(mother, offspr, mate.name)
from DomesticCat as mother
inner join mother.mate as mate
left outer join mother.kittens as offspr" but don't know how to implement.


OrderLine
orderLineId
productId
qty

Product
prductId
productName

TIA,
iduniq


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 07, 2005 12:48 am 
Expert
Expert

Joined: Mon Jul 04, 2005 5:19 pm
Posts: 720
select o.qty, p.productName from OrderLine o, Product p where p.pruductId = 10


OrderLine needs a Product property, not a productId


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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.