-->
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.  [ 5 posts ] 
Author Message
 Post subject: Lazy load a property
PostPosted: Wed Sep 03, 2008 5:17 am 
Newbie

Joined: Tue Jul 22, 2008 5:19 am
Posts: 10
Hello, I'm using Hibernate 3
Anyway I need to lazy upload a property when I do a select.
In the configuration file I put the property lazy="true", but it doesn't work, it still load the property.
I read in the documentation that in the property the lazy attribute requires
"build-time bytecode instrumentation". Please what does it mean? Can you provide an example?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 03, 2008 5:36 am 
Expert
Expert

Joined: Wed Mar 03, 2004 6:35 am
Posts: 1240
Location: Lund, Sweden
http://www.hibernate.org/hib_docs/v3/re ... properties


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 03, 2008 5:48 am 
Newbie

Joined: Tue Jul 22, 2008 5:19 am
Posts: 10
I saw, but I don't know what is build time instrument, I read that is possible to don't load a property with criteria....an example?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 03, 2008 6:16 am 
Expert
Expert

Joined: Wed Mar 03, 2004 6:35 am
Posts: 1240
Location: Lund, Sweden
It means that Hibernate will change your getSomeProperty() method to something that is more like:

Code:
public String getSomeProperty()
{
  if (!isSomePropertyLoaded)
  {
    someProperty = lazyLoadProperty(....);
    isSomePropertyLoaded = true;
  }
  return someProperty;
}


Note! This is just my conceptual idea of what happens. I have no idea that it really works like this.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Sep 03, 2008 6:29 am 
Newbie

Joined: Tue Jul 22, 2008 5:19 am
Posts: 10
ok....but is there a way to exclude the loading of a property with Criteria?
an example?
sorry for me I'm new of hibernate


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