I have 2 Hibernate objects :
Dero and Motif.
a Dero has a set of Motif.
I load a Dero object from the DB fine. but when I try to access its set of Motif :
assertEquals(dero.getMotifRefus(),deroFromDB.getMotifRefus());
I get an exception :
org.hibernate.LazyInitializationException: failed to lazily initialize a collection
of role: com.dossier.Derogation.motifRefus, no session or session was closed
at
org.hibernate.collection.AbstractPersistentCollection.throwLazyInitializationException(AbstractPersistentCollection.java:358)
How do I solve this ?