-->
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 to load all object graph when lazy loding is used
PostPosted: Thu May 06, 2004 6:41 am 
Regular
Regular

Joined: Fri Nov 21, 2003 10:23 am
Posts: 81
I have defined objects as proxy, so lazy loading is enabled.
example:
Code:
/**
* @hibernate.class table="INSTRUMENT_TBL" proxy="com.domainmodel.Instrument"
* @jboss-net.xml-schema urn="Excom2:Instrument"
*/
public class InstrumentStatic implements java.io.Serializable {
    public Long instrumentId;
     ..... etc......


How can I achieve loading all the object graph using generic code?

Because Hibernate.initialize(instrument) does not initialize all object graph. I would like to have method that initialize all object graph - the only one method (general) usable for all potential objects.

Thanks lot


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 06, 2004 7:39 am 
Beginner
Beginner

Joined: Sat May 01, 2004 2:44 am
Posts: 32
Location: Brisbane, Australia
This is something I have also considered would be useful. Rather than just Hibernate.initialize(...), a method call that could force initialization on an arbitrary number of proerties or property depth.

Perhaps something like Hibernate.initialize(Object proxy, int depth), which would initialize all proxies in the obejct or collection, to the specified depth by introspection.

Scott


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 06, 2004 8:06 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
You cazn easily implement this yourself using the Hibernate ClassMetadata.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 06, 2004 8:19 am 
Beginner
Beginner

Joined: Sat May 01, 2004 2:44 am
Posts: 32
Location: Brisbane, Australia
gavin wrote:
You cazn easily implement this yourself using the Hibernate ClassMetadata.


Thanks, that looks like a good way to do it.

Scott


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.