-->
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: how can i set lazy load in one-to-one mapping
PostPosted: Tue Aug 02, 2005 3:16 am 
Newbie

Joined: Tue Apr 26, 2005 2:22 am
Posts: 5
in hibernate2.18, i have to table Company and it's Profile,
below is the mapping in Company mapping
<one-to-one name="Profile" class="Profile" property-ref="accCompany" constrained="true" />

and in Profile i set <class
name="Profile"
table="PROFILES"
lazy="true"
>
<many-to-one
name="accCompany"
class="com.tradeeasy.pojos.AccCompany"
not-null="true"
unique="true"
>
<column name="COMP_ID" />
</many-to-one>
but everytime i load company, it's profile was loaded automatically by hibernate. can anybody tell me how can i realize one-to-one lazy load, thanks in advance.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 02, 2005 8:08 pm 
Senior
Senior

Joined: Wed Jul 13, 2005 4:31 pm
Posts: 142
Location: Seattle, WA
have you tried explicitly setting lazy to true ...

<one-to-one name="Profile" class="Profile" property-ref="accCompany" constrained="true" lazy="true" />


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 03, 2005 4:04 am 
Newbie

Joined: Tue Apr 26, 2005 2:22 am
Posts: 5
but in hiberante2.18, one-to-one don't have lazy property


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 03, 2005 1:00 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
property-ref associations can't be lazy


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