-->
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.  [ 1 post ] 
Author Message
 Post subject: FetchType EAGER and the criteria
PostPosted: Wed Jun 18, 2008 11:05 am 
Newbie

Joined: Fri Oct 12, 2007 4:58 am
Posts: 4
Location: Dublin
Hi guys,
I have got an issue on the FetchType EAGER and the criteria.

Environment:
java 1.6
jboss-version: 4.0.5.GA
Seam-Version: 1.2.1.GA
Hibernate-Version: 3.2.3.ga


if I have the following mapping in the object A:
@OneToMany(fetch=FetchType.EAGER) mapping a Set<B>


and then I retrieve the list of objects A through criteria:
Criteria c = session.createCriteria(A.class);
... the result of c.list() is quite strange. In fact it duplicates A's occurrences every time that in B there is a reference to A (the query is in outer join with B).


if on the contrary I retrieve the list of objects A through HQL it seems to work as I want.


I don't know if there is a further option that I have to add to the mapping to avoid the problem.
for the moment I skipped out it changing the FetchType.LAZY.

did someone face the same problem?

Gianpaolo


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.