-->
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.  [ 1 post ] 
Author Message
 Post subject: How to insert into all objects loaded within same session
PostPosted: Tue Sep 25, 2012 5:18 pm 
Newbie

Joined: Tue Sep 25, 2012 5:06 pm
Posts: 1
Hello,

I have some abstract entity class named MyAbstractEntity with some instance variabe named myRef of type MyRef. All my entity classes are subclasses of this abstract class and hence inherit the variable myRef. Now I want that for all entity objects loaded from the db from within the same hibernate session the instance variable myRef is set to some specific instance. My question is whether there is an easy way to get this done through hibernate. I can traverse the loaded objects with all its subjects and their subobjects, etc., but this would involve a little coding work. Not a problem, but if there were a way in hibernate to make hibernate set the variable myRef for every object loaded from the same session, the task would be done in an easy way for me. I guess I could pass that instance on to some constructor, but constructors are tedious to work with. Any hints for a more elegant solution appreciated.

Cheers, Oliver


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

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.