-->
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: Eager fetching + duplicates result
PostPosted: Fri May 04, 2007 1:16 am 
Newbie

Joined: Sat Oct 01, 2005 3:53 am
Posts: 5
Hi all,

I have faced the classical problem of duplicates result when using an eager fetching.

In one case, I thought having duplicates result but instead I had unique result.

A has a OneToMany association with B.

I insert 2 instances of A (each of them are associated with 2 B). When running the query "from A a left join fetch a.bs", I have a list which contains 2 A (no duplicates).

I add a new instance of A (with a collections of 2 B), I run again the query, and as expected, I have a list with duplicates result.

I didn't find any bug on this point.


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 04, 2007 1:25 am 
Hibernate Team
Hibernate Team

Joined: Mon Aug 25, 2003 9:11 pm
Posts: 4592
Location: Switzerland
FAQ

_________________
JAVA PERSISTENCE WITH HIBERNATE
http://jpwh.org
Get the book, training, and consulting for your Hibernate team.


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 04, 2007 2:56 am 
Newbie

Joined: Sat Oct 01, 2005 3:53 am
Posts: 5
I didn't see anything about this problem in the FAQ.

I suppose you speak about "Hibernate does not return distinct results for a query with outer join fetching enabled for a collection".

The problem I have faced is different than this one : when I run my first query, I get no duplicate even if I set the resultTransformer to Criteria.ROOT_ENTITY.


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.