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: Load Eager when lazy=true
PostPosted: Thu Sep 03, 2009 4:22 pm 
Newbie

Joined: Thu Sep 03, 2009 4:12 pm
Posts: 4
Hi,

i am doing an app on asp.net. When a try to login all the collections related to the user are also loaded even though in the mapping file is lazy=true

The tables in the data base are still empty. There's only one user. But when I try to debug the entity returned from an ICriteria I can see the values of the collections and the other collections related with the entities inside the first collection.

I do not know if I am doing something wrong. Here is the mapping file and i think everything looks ok.

Does anyone have a suggestion?

Here is the mapping file:
Code:
<class name="Domain.Entities.User, Domain" table="RSM_User" >

<id name="Id" access="nosetter.camelcase"  column="PkUser" type="System.Int32" unsaved-value="null">
   <generator class="hilo">
      <param name="table">hibernate_unique_key</param>
      <param name="column">next_hi</param>
      <param name="max_lo">100</param>
   </generator>
</id>

<property name="Password" column="Password"  not-null="true" type="System.String"  length="50" insert="true" update="true"/>
<property name="Username" column="Username"  not-null="true" type="System.String"  length="50" insert="true" update="true"/>
<property name="Active_YN" column="Active_YN"  not-null="true" type="Utils.CustomTypes.YNType, Utils"  length="1" insert="true" update="true"/>
<many-to-one fetch="join" name="Company"   not-null="true"  insert="true" update="true">
   <column name="FkCompany"/>
</many-to-one>
<many-to-one fetch="join" name="Person"   not-null="true"  insert="true" update="true">
   <column name="FkPerson"/>
</many-to-one>
<many-to-one fetch="join" name="Role"   not-null="true"  insert="true" update="true">
   <column name="FkRole"/>
</many-to-one>
<many-to-one fetch="join" name="UserType"   not-null="true"  insert="true" update="true">
   <column name="FkUserType"/>
</many-to-one>

<set name="Attachments" cascade="none" inverse="true" lazy="true" >
   <key>
      <column name="FkUser"/>
   </key>
   <one-to-many class="Domain.Entities.Attachment, Domain"/>
</set>
<set name="Comments" cascade="none" inverse="true" lazy="true" >
   <key>
      <column name="FkUser"/>
   </key>
   <one-to-many class="Domain.Entities.Comment, Domain"/>
</set>
<set name="Filters" cascade="none" inverse="true" lazy="true" >
   <key>
      <column name="FkUser"/>
   </key>
   <one-to-many class="Domain.Entities.Filter, Domain"/>
</set>
</class>
</hibernate-mapping>


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.