I have an object wich has a lazy-loading relationship . After I loaded the object (without loading the lazy-loading child), I closed the session, thus detaching the object.
If I understand correctly, if I try myObject.getLazyChild(), I will get a LazyInitializationException.
Is there a way to have the myObject.lazyChild to be automatically set to null in such a situation?
Of course, I can call have myObject.setLazyChild( null ); , but I'm looking for a way to do this automatically.