-->
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.  [ 2 posts ] 
Author Message
 Post subject: lazy load always loading
PostPosted: Thu Sep 29, 2005 5:49 pm 
I have my classes set to lazy="true" but all my collections (sets) are being populated anyway. Everything else appears to be working fine, so I think I have my mapping files correct, but here they are.

Code:
<class name="Ideaca.NHTest.Entities.BusinessAssociate, Ideaca.NHTest.Entities" table="business_associate" lazy="true">
      <id name="Id" column="ba_id" type="Int32" unsaved-value="0">
         <generator class="native" />
      </id>
      <property name="FirstName" column="f_name" type="String(50)"/>
      <many-to-one name="BAType" class="Ideaca.NHTest.Entities.BAType, Ideaca.NHTest.Entities" column="ba_type_id" insert="true" update="true"/>
      <set name="AddressesNH" table="ba_address">
         <key column="ba_id"/>
         <many-to-many class="Ideaca.NHTest.Entities.Address, Ideaca.NHTest.Entities" column="address_id"/>
      </set>
   </class>


All my properties are virtual (I read another post that this was required). I have also tried putting lazy="true" on the 'set'

Thanks


Top
  
 
 Post subject:
PostPosted: Thu Sep 29, 2005 6:38 pm 
I think I figured it out.

I wasn't closing my session, so when I went to retrieve the child entities I was retrieving the values then.


Top
  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.