Your problem does not come from the mapping. It comes from your session management.
If you have entity A and entity B (A lazy relation to B)
There can be two possible reasons:
1 - our session is closed when you call A.getB
or,
2 -You have an open session, but it is not the on in which A was loaded.
For case 1, make sure that the scope of the session spans your whole process.
For case 2, either reload A from the DB prior to calling A.getB, or try to reassociate A to the session.
Hope that helps,
_________________ Vincent Giguère
J2EE Developer
|