This week's book giveaway is in the Agile and Other Processes forum. We're giving away four copies of DevSecOps Adventures: A Game-Changing Approach with Chocolate, LEGO, and Coaching Games and have Dana Pylayeva on-line! See this thread for details.
I'm not sure I follow your question. Hibernate will initialize your lazy collection when you access a property of that collection - why do you need to do it a different way?
Paul Sturrock wrote:I'm not sure I follow your question. Hibernate will initialize your lazy collection when you access a property of that collection - why do you need to do it a different way?
Outside of the transaction (detached), I will need to access the lazy ones.
Right. Typically if you know your code is going to use the collection you would initialize it in the session before you detach it, this saves you using Hibernate-specific code outside your DAO layer.