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>