-->
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.  [ 4 posts ] 
Author Message
 Post subject: Fetch EAGER returns double results
PostPosted: Mon May 29, 2006 9:24 am 
Newbie

Joined: Thu Jan 26, 2006 4:26 am
Posts: 16
Hello, im using Hubernate 3.1.3 with Annotations 3.1b9. When i use an eager fetch strategy, and i execute a findall method (using criteria without any criteria), in list of results, the same object appears twice, while if i use a lazy fetch strategy only one time appears. Of course in database only one object is found, for example if findAllCars with lazy strategy returns Car A and Car B, in Eager returns Car A, Car A, Car B and Car B.

This is used in a One to Many, Many to One with middle table with relationship attributes.

Anybody knows why happens?

Thank you very much.


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 29, 2006 10:21 am 
Newbie

Joined: Thu Jan 26, 2006 4:26 am
Posts: 16
just don't know if it is a bug or what, but if i use a createQuery rather than criteria works perfectly.


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 29, 2006 11:38 am 
Expert
Expert

Joined: Sat Oct 25, 2003 8:49 am
Posts: 490
Location: Vrhnika, Slovenia
This is common behaviour.
Search forum and JIRA for explanation.


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 31, 2006 12:14 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
please read the collection chapter included in Hibernate Annotations reference documentation. Esp the difference between a bag semantic and other collection semantics

_________________
Emmanuel


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