That's exactly what you have with your lazy initialization, and tha's why you are getting that exception, because you're trying to access an object that was never created. Neither you or hibernate did it at any moment.
Maybe nonsense, but, what if you try something like:
myclass.classObjects = session.load(Set.class, [Set id here]);
Maybe the set mapping makes that work, but I don't know how are you going to get the Set id.
Just giving ideas.
However, I'm really interested in how this topic is solved, because, as you pointed before, the way I understand the lazy inicialization makes you loose the ORM capability.
|