-->
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.  [ 15 posts ] 
Author Message
 Post subject: Lazy many-to-one requires build-time instrumentation?
PostPosted: Tue Mar 01, 2005 4:24 am 
Regular
Regular

Joined: Thu Nov 13, 2003 2:55 am
Posts: 71
Location: Sweden
I see that Hibernate3 has per-property lazy fetching. Though the roadmap says
Quote:
This feature requires build-time bytecode instrumentation using an Ant task. If Hibernate encounters uninstrumented classes at runtime, the feature will be transparently disabled.


Is this true even for many-to-one (i.e. entity) properties? Or only for value type properties?


Top
 Profile  
 
 Post subject: Re: Lazy many-to-one requires build-time instrumentation?
PostPosted: Tue Mar 01, 2005 9:25 am 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
mate wrote:
I see that Hibernate3 has per-property lazy fetching. Though the roadmap says
Quote:
This feature requires build-time bytecode instrumentation using an Ant task. If Hibernate encounters uninstrumented classes at runtime, the feature will be transparently disabled.


Is this true even for many-to-one (i.e. entity) properties? Or only for value type properties?


It is designed for things like "large" strings, but it is possible to use it as replacement for proxies (probably it is not a bad idea too).


Top
 Profile  
 
 Post subject: Re: Lazy many-to-one requires build-time instrumentation?
PostPosted: Tue Mar 01, 2005 10:01 am 
Regular
Regular

Joined: Thu Nov 13, 2003 2:55 am
Posts: 71
Location: Sweden
baliukas wrote:
It is designed for things like "large" strings, but it is possible to use it as replacement for proxies (probably it is not a bad idea too).

But does it require build-time instrumentation?

(What I want to do is, for example, when querying the "article" table I do not want proxied objects, but when fetching articles via an "order line" object, I want them lazily fetched)


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 01, 2005 10:59 am 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
It will work as expected, it is not required at this time.
Probably this stuff confuses, but it is just a new optional feature for "large" value fields.


Top
 Profile  
 
 Post subject: Re: Lazy many-to-one requires build-time instrumentation?
PostPosted: Tue Mar 01, 2005 12:56 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
mate wrote:
I see that Hibernate3 has per-property lazy fetching. Though the roadmap says
Quote:
This feature requires build-time bytecode instrumentation using an Ant task. If Hibernate encounters uninstrumented classes at runtime, the feature will be transparently disabled.


Is this true even for many-to-one (i.e. entity) properties? Or only for value type properties?

Only for value type properties. Many to one lazy mecanisme still work the way it has always been.

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 01, 2005 1:05 pm 
Hibernate Team
Hibernate Team

Joined: Thu Dec 18, 2003 9:55 am
Posts: 1977
Location: France
i'm not sure, here is what we see in H3b3 changelog
* added lazy="true" to many-to-one and one-to-one mappings (requires bytecode instrumentation)

_________________
Anthony,
Get value thanks to your skills: http://www.redhat.com/certification


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 01, 2005 1:11 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
This is on top on the class lazy loading.
If your class is lazy, the you don not need to set lazy="true" on many to one (Actually I'm wondering whether we should ignore it or not).
If your class is not, then build code enhancement is mandatory.
I'd definetly recommend the first one

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 01, 2005 1:43 pm 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
Probably it was changed (I just gues it from source code). Eclipse builder must must be usefull for this stuff, I can implement it in cglib or contribute it for hibernate tools project if somebody is going to use it.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 01, 2005 1:46 pm 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
BTW, it is possible to add chained "FieldProvider" transformation to this task. It adds interface to class for direct field access.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 01, 2005 3:56 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
baliukas you are very welcome to provide any enhancements to our instrument task - and adding "hibernate builder" support to eclipse is on the roadmap (to support seamless generation of pojo's etc.) - you are very welcome to contribute on that!

/max

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 01, 2005 4:37 pm 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
Ok. this is very interesting for me, I develop eclipse pluggins and MDA /code generation stuff myself.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Mar 01, 2005 8:15 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
Does this mean you wont like to contribute this stuff to the existing plugins ? ,(

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 02, 2005 2:38 am 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
Yes, I want to contribute and I think I can help (I develop GEF based graphical editors at this time and I have more fun than with databases)
Do you have some special list for tools projects ?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 02, 2005 6:13 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
no special list. hibernate-devel and-or the tools forum.

GEF skills is also interesting for us to visualize the Configuration in Hibernate 3. Let me know if you want to work on that too ,)

_________________
Max
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Mar 02, 2005 6:26 am 
CGLIB Developer
CGLIB Developer

Joined: Thu Aug 28, 2003 1:44 pm
Posts: 1217
Location: Vilnius, Lithuania
Ok, I will resubscribe to hibernate-devel, it is better place to discuss. I am subscribed, but have too many mail accounts to find the right one :)


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