Hi everybody,
I'm searching a mean (other thant creating DTO) to be able to detach an object from its hibernate session.
In fact, I retrieve an object list each of them containing objects sets and I'd like to force the initialization of those sets.
The object list is destinated to be serialized. When deserialized, the session is not available anymore.
I don't want to force the lazy to false in the hibernate mapping files beacause of the use of the service by others layers which may work with lazy loading.
I have already tried to use the following methods :
Code:
HibernateTemplate.initialize() [Spring]
-> "Force initialization of a Hibernate proxy or persistent collection."
Hibernate.initialize()
-> "provide the application with a convenient way of working with lazily initialized collections or proxies" ... "as long as its Session is still open"
But this give anything...
any help will be greatly appreciated !
Thanks to all,
Sebastien