-->
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: callbacks and object initalisation
PostPosted: Thu Jan 08, 2004 7:28 am 
Beginner
Beginner

Joined: Thu Oct 30, 2003 6:29 am
Posts: 30
Location: Germany, KA
hi,

i want to initalise all my persisten objects after they are loaded from the db without calling s.th. like init(Object abc) seperatly. I could do so, but than I can't really take advantage of lazy-loading.
i.e. if I call init on every object in a resulting Collection within my finder-method, every object is retrieved from the database, not mentioning all related objects that have to be initalised, too. But using the hibernate-callbacks is not possible either, because I need to give a bunch of parameters to my init()-method, and I can not store any values within the hibernate-session, which is the only parameter of the callback methods.
what I want: a method that is called just in time the object is retrieved from the database supporting lazy-load. and i need to pass an object to the init()-method of the object.
the question is:
a) is onLoad() called when an object is actually retrieved from the database supporting lazy-load?
b) can I put some object into the hibernate session or is there another way to pass an object to this callback-method

thanks alot
marie


Top
 Profile  
 
 Post subject: Re: callbacks and object initalisation
PostPosted: Mon Jan 12, 2004 7:41 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Marie wrote:
a) is onLoad() called when an object is actually retrieved from the database supporting lazy-load?

Give it a try, I'm interested.
Marie wrote:
b) can I put some object into the hibernate session

No :-(

_________________
Emmanuel


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.