Once you return from your Dao using the hibernateTemplate helper method, how does the session stay in scope and allow you to lazily load the collection?
Because it Sessionis not yet closed, and your essence, thus, remains constant (in contrast to the state of the object A separate object). Until your face is removed from you, you can use lazy assemblies and proxies. See Chapter 10.1. The Hibernate object indicates for more detailed information about these states (it is very important to understand them and the terminology used).
?
-, , . javadoc HibernateTemplate:
Lazy loading Hibernate, , OpenSessionInViewFilter/Interceptor.
javadoc OpenSessionInViewFilter OpenSessionInViewInterceptor, , , Hibernate "Open Session in View" ".
, , getcurrentsession, /?
, . HibernateTemplate, doExecute(), . / OpenSessionInViewFilter/Interceptor, .
, spring , ? ?
, : .
, /?
, . Hibernate - . , , .
PS: , , . spring Hibernate javadoc. , , , , .