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
|