-->
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: Distinct objects from left join fetch of bag
PostPosted: Tue Oct 11, 2005 8:00 am 
Senior
Senior

Joined: Sat Sep 03, 2005 12:54 am
Posts: 139
Hi,

I have been experimenting with the table-per-subclass inheritance mapping and I just gotta say that NH is so damned good and easy to use that I can't believe I used to do things the hard way! Everyone should be using this product end of story! Well done NH team :D

So, on to my problem! I have an abstract base class and another couple of subclasses that inherit from this. One of these subclasses has a bag that is implemented as a many to many association.

I am trying to left join fetch the bag but I am finding that NH is returning duplicate objects in the list even after I have added the distinct clause to the HQL.

Can this be done!?

Cheers,

Jason


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 17, 2005 9:29 am 
Regular
Regular

Joined: Mon Jul 18, 2005 4:10 am
Posts: 92
Location: Poland
Hi

you can try to exclude duplicates with ISet, e.g.:
Code:
dim set as ISet=new HashedSet(query.List())


I'm not sure but it is possible that your objects should be comparable (implement IComparable)

_________________
michal


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 17, 2005 10:04 am 
Senior
Senior

Joined: Sat May 14, 2005 8:40 am
Posts: 130
There is a JIRA issue for this: http://jira.nhibernate.org/browse/NH-300. Apperantly it has not been solved yet.

_________________
Cuyahoga


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.