Most probably you will want to lazily access associations, unless it makes sense to always return your list of details. That being said, the lazy initialization should occur when the associated property is first accessed, i.e. when you call getDetails(). What is the exception you are seeing?
I am using spring framework and DAO pattern and in springframework there is a method --> getHibernateTemplate() and with this method we select or save and object but this framework handle the transactions itself so when I am going to load a lazy collection an error occurred and says that session was closed and can not load a lazy object.
In Spring, I think I am right in saying you don't need to worry about Hibernate sessions if you use a HibernateTemplate to wrap the Hibernate nuts-and bolts, assuming you are using this HibernateTemplate from within a Spring-driven or JTA transaction. If your transaction has ended, the session is closed. Are you accessing this object within the same transaction you got it?
I’ve looked at a lot of different solutions, and in my humble opinion Aspose is the way to go. Here’s the link: http://aspose.com
subject: set lazy to false in runtime in Hibernate