There is more than one topic about this kind of problem and no answer.
If the question is stupid or irrelevant, please let me know.
For the instance, it's causing me a BIG problem so I don't have any other choice than posting it again.
In Hibernate in Action, Chapter 7(7.3.2) it is suggested that if we want to disable outer joint fetching(using criteria api), we can call the setFetchMode("bids",FetchMode.LAZY) where bids is the associated object we don't want to carry up from the database.
I'm trying this feature and it's not working for me.
here is how I'm trying it:
Criteria criteria=session.createCriteria(TStructureLibelle.class);
criteria.setFetchMode("structure",FetchMode.LAZY);
criteria.add(Expression.eq("structure.codeStructure",codeStructure));
criteria.addOrder(Order.asc("dateFinValidite"));
return criteria.list();
I've been searching the list to find an eventual answer in vain.
So any help would be greetly appreciated.
Meissa
|