-->
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: Fetching association problem
PostPosted: Thu Mar 17, 2005 6:07 am 
Beginner
Beginner

Joined: Wed Feb 23, 2005 9:24 am
Posts: 28
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


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.