-->
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.  [ 8 posts ] 
Author Message
 Post subject: Lazy loaded one-to-one
PostPosted: Wed Mar 02, 2005 5:38 pm 
Red Hat Associate
Red Hat Associate

Joined: Mon Aug 16, 2004 11:14 am
Posts: 253
Location: Raleigh, NC
All,

I just noticed that the laziness of a persistent class is tied to the class mapping, not to the association. I can't find much discussion about how this came to be, but it seems to me that one might want the lazy-load attribute on a per-association basis, not a per class basis. Is there a way to control this?

-Chris


Top
 Profile  
 
 Post subject: Re: Lazy loaded one-to-one
PostPosted: Wed Mar 02, 2005 6:28 pm 
Regular
Regular

Joined: Thu Dec 18, 2003 2:14 am
Posts: 103
Location: Brooklyn, NY
Both classes and associations can be lazy.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 02, 2005 6:35 pm 
Red Hat Associate
Red Hat Associate

Joined: Mon Aug 16, 2004 11:14 am
Posts: 253
Location: Raleigh, NC
There is nothing documented for one-to-one or many-to-one that appears to specify the laziness. Can you explain?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 02, 2005 6:48 pm 
Regular
Regular

Joined: Thu Dec 18, 2003 2:14 am
Posts: 103
Location: Brooklyn, NY
http://www.hibernate.org/hib_docs/v3/re ... ns-mapping


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 02, 2005 6:53 pm 
Red Hat Associate
Red Hat Associate

Joined: Mon Aug 16, 2004 11:14 am
Posts: 253
Location: Raleigh, NC
Thanks for the reply, but maybe I wasn't specific enough. I'm talking about one-to-one associations. The kind that generate a CGLIB proxy at runtime. In some cases this may also be a many-to-one, if you aren't doing the association via a shared foreign key. In any case, I'm not talking about collections.

-Chris


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 02, 2005 7:05 pm 
Regular
Regular

Joined: Thu Dec 18, 2003 2:14 am
Posts: 103
Location: Brooklyn, NY
perhaps fetch="select"


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 02, 2005 7:14 pm 
Red Hat Associate
Red Hat Associate

Joined: Mon Aug 16, 2004 11:14 am
Posts: 253
Location: Raleigh, NC
That looks to be an option only in H3, and then it seems to pertain only to subclass/inheritance stuff, but I could be wrong here.

I'd like to have a lazy reference to some class in one place, yet have a direct reference to the same class in another place. Anyone know the answer to this beyond speculation?

-Chris


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 02, 2005 9:16 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
H3 has the many-to-one lasy load option but its a field level lazy load attribute meaning it requires build time enhancement. Personally, class level lazy loading works very well and its easy enough to force the proxy to load the object when required.


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