-->
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.  [ 5 posts ] 
Author Message
 Post subject: Hibernate 3 migration: duplicate entities in child Bags.
PostPosted: Wed Sep 28, 2005 12:20 pm 
Regular
Regular

Joined: Tue Dec 09, 2003 2:39 pm
Posts: 106
Location: Toronto, Canada
After migrating to H3, several queries seem to be demonstrating odd behavior we didn't expect.

We had some Criteria queries that we'd previously have to distinct via a HashSet, which was expected. However, now it seems we need to do the same for the child Bags of same said entities. Whereas in H2.X we did not have to do this.

We can live with this, however, is this expected behavior in H3 given the Criteria makeover?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 28, 2005 3:22 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
maybe you have multiple fetch joins - that was ignored in h2, but allowed with H3 but does not work with bags because it is not possible to distinguish between redundant entities.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 28, 2005 3:36 pm 
Regular
Regular

Joined: Tue Dec 09, 2003 2:39 pm
Posts: 106
Location: Toronto, Canada
Bang! Right on, Max. Thanks.

In this case, is it recommended to refactor the queries or simply distinct the bags?

I mean, is there any benefit to doing the former if the query works?

Cheers,
Roll


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 28, 2005 3:39 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
i would refactor the queries .... distincting the bags might remove duplicates that should be there.

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 28, 2005 3:59 pm 
Regular
Regular

Joined: Tue Dec 09, 2003 2:39 pm
Posts: 106
Location: Toronto, Canada
Just for future readers, Max when you said:

Quote:
maybe you have multiple fetch joins

You were referring to multiple fetch joins on collections as multiple fetch joining on associations was already allowed, I presume.

Moreover, I think that for our model distincting the bag is acceptable. However, it makes one wonder why we're not using a Set here. Thank you for your insight.


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