-->
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: No duplicate in query results
PostPosted: Sun Oct 24, 2004 12:21 pm 
Newbie

Joined: Tue Oct 19, 2004 4:18 am
Posts: 9
Hello folks,

Query q1 = session.createQuery("select cust from Customer cust "
+ "join cust.orders custorder "
+ "join custorder.orderlines orderline "
+ "where orderline.product.price > 100.00");

this query returns a list of Customer instances. But the list contains multiple references to the same customer instances.
How is it possible to have unique instances (no duplicates) without re-wprking my result. Is there a kind of 'unique' keyword to add to my query ?

thanks for your help

Nicolas

_________________
Nicolas Brasseur - Loop Factory - http://www.loop.be


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 24, 2004 2:36 pm 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
distinct? This is just the same as with an SQL query.


Top
 Profile  
 
 Post subject: ...
PostPosted: Sun Oct 24, 2004 3:59 pm 
Newbie

Joined: Tue Oct 19, 2004 4:18 am
Posts: 9
too easy ... it just rocks !

_________________
Nicolas Brasseur - Loop Factory - http://www.loop.be


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.