-->
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.  [ 2 posts ] 
Author Message
 Post subject: suppress child table loading at RUNTIME?
PostPosted: Sat May 21, 2005 10:10 am 
Newbie

Joined: Mon May 16, 2005 4:40 am
Posts: 5
Hi,

Can someone let me abt how to control the loading of the child tables
at runtime - in the java code. It is possible using the mapping files.
But i need to know if it is possible with java.

Thanks,
godhs


Top
 Profile  
 
 Post subject:
PostPosted: Sat May 21, 2005 3:27 pm 
Senior
Senior

Joined: Tue Feb 08, 2005 5:26 pm
Posts: 157
Location: Montréal, Québec - Canada
If you mean: triggering the initialization of lazy initialized associations, it can be done this way:

Lets say you have a Foo with a one-to-many association to Bar (foo.getBars()), you can issue the following command:
Code:
-- within the scope of a session ----
Hibernate.initialize(foo.getBars());


If it is not mapped as lazy=true, you will not be able to control it, because it is always loaded by default.

Hope that helps,
Vincent.

_________________
Vincent Giguère
J2EE Developer


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