-->
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.  [ 4 posts ] 
Author Message
 Post subject: <many-to-one> and lazy loading does not work
PostPosted: Tue Oct 24, 2006 7:48 am 
Newbie

Joined: Tue Aug 29, 2006 10:56 am
Posts: 15
Hi,

in my application <many-to-one> lazy loading does not work .

Hibernate version:3.1.3/3.2.0ga
Mapping:
Code:
<hibernate-mapping>
   <class name="de.mba.MyClass"
      table="MyTable">
      <id name="poi" type="string">
         <column name="POI" length="22" />
         <generator class="assigned" />
      </id>
      <property name="lupdDatetime" type="timestamp">
         <column name="LUPD_DATETIME" length="26" />
      </property>
      <property name="lupdProcess" type="string">
         <column name="LUPD_PROCESS" length="30" />
      ...
     
      <many-to-one name="assoc1"
         class="de.mba.MyAssoc"
         insert="false" update="false" not-found="ignore">
         <column name="POI" />
      </many-to-one>
     
   </class>
</hibernate-mapping>


The declaration of the attribute lazy with the value 'proxy' in the <many-to-one> element does not work too.
Thanks for your help!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 24, 2006 8:06 am 
Beginner
Beginner

Joined: Thu Sep 22, 2005 10:48 am
Posts: 30
Location: Rio de Janeiro, Brazil
set fetch="join" in your many-to-one mapping to automatic fetch


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 24, 2006 9:44 am 
Newbie

Joined: Tue Aug 29, 2006 10:56 am
Posts: 15
Thanks for your answer. It does not work.

In the reference guide:
Join fetching - Hibernate retrieves the associated instance or collection in the same SELECT, using an OUTER
JOIN.

I think that is not the solution.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Nov 03, 2006 2:04 pm 
Newbie

Joined: Wed Jan 21, 2004 5:12 pm
Posts: 8
I'm having a similar issue. It appears that the issue is with the not-found attribute. Setting that to ignore prevents Hibernate from proxying the many-to-one entity, and therefore disables the lazy loading. I think it has to do this to determine whether or not to assign a null value.

Scott


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

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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.