I'm trying to laod an entity without carrying the associated object.
As suggested in HIA chapter 7, I'm explicitely disabling outer-join fetching
by calling the setFetchMode("associate",Fetchmode.LAZY") on my criteria object.
But it seeem like that the Criteria object is completely ignoring this setting.
The associated object is still there.
here is the code:
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();
here is the corresponding mapping:
<many-to-one
name="structure"
class="com.nxbp.nis.biosphere.model.TStructure"
cascade="none"
outer-join="auto"
update="true"
insert="true"
access="property"
>
<column
name="CodeStructure"
/>
</many-to-one>
Can someone tells me how I can efficiently prevent from loading the associated object.
thank in advance.
Meissa
|