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
|
|