Hello.
I have been reading the Java Persistence with Hibernate book and on page 258 it describes how to Map a collection of embedded objects. I've been able to implement this mapping successfully. However when I try to access the mapped collection of embedded objects, I get the following error:
Code:
org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: Transaction.states, no session or session was closed
Now I understand why this is happening; as my Transaction is detached and Transaction.states have not been initialized; but I thought since these states are embedded in the Transaction class they would be automatically populated when I get the Transaction from the database, via a session.get(type, id).
Any help with this is welcomed and appreciated.
Thanks!
Tonté