-->
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.  [ 3 posts ] 
Author Message
 Post subject: how avoid children loading?
PostPosted: Mon Jun 13, 2005 11:31 am 
Newbie

Joined: Mon Sep 01, 2003 10:40 am
Posts: 17
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:3.01

Mapping documents:
<hibernate-mapping default-lazy="false">
<class name="Test" table="TEST" dynamic-update="true">
<composite-id name="id" class="PkTest">
<key-property name="idTest" type="integer" column="ID_TEST" />
....
</composite-id>

<property name="title" column="TITLE" type="string"/>
...

<set name="children" inverse="true" >
<key>
<column name="ID_TEST" />
</key>
<one-to-many class="SubTest"/>
</set>

</class>
<class name="SubTest" table="SUB_TEST" dynamic-update="true">
.....


When I load a Test class, with session.load(class myclass,serializable id) I get also all children.
How can I load only parent object ?


Top
 Profile  
 
 Post subject: Re: how avoid children loading?
PostPosted: Mon Jun 13, 2005 11:33 am 
Expert
Expert

Joined: Mon Feb 14, 2005 12:32 pm
Posts: 609
Location: Atlanta, GA - USA
belcore wrote:
Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp

Hibernate version:3.01

Mapping documents:
<hibernate-mapping default-lazy="false">
<class name="Test" table="TEST" dynamic-update="true">
<composite-id name="id" class="PkTest">
<key-property name="idTest" type="integer" column="ID_TEST" />
....
</composite-id>

<property name="title" column="TITLE" type="string"/>
...

<set name="children" inverse="true" >
<key>
<column name="ID_TEST" />
</key>
<one-to-many class="SubTest"/>
</set>

</class>
<class name="SubTest" table="SUB_TEST" dynamic-update="true">
.....


When I load a Test class, with session.load(class myclass,serializable id) I get also all children.
How can I load only parent object ?


remove the default-lazy="false" from your mapping file.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Jun 13, 2005 11:43 am 
Beginner
Beginner

Joined: Thu May 26, 2005 12:31 pm
Posts: 25
set lazy="true".


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.