Interface that specifies a basic set of Hibernate operations,
implemented by HibernateTemplate . Not often used, but a useful
option to enhance testability, as it can easily be mocked or stubbed.
Defines HibernateTemplate's data access methods that
mirror various Session methods. Users are
strongly encouraged to read the Hibernate Session javadocs
for details on the semantics of those methods.
Note that operations that return an Iterator (i.e.
iterate(..)) are supposed to be used within Spring-driven
or JTA-driven transactions (with HibernateTransactionManager ,
JtaTransactionManager ,
or EJB CMT). Else, the Iterator won't be able to read
results from its ResultSet anymore, as the underlying
Hibernate Session will already have been closed.
Note that lazy loading will just work with an open Hibernate
Session, either within a transaction or within
OpenSessionInViewFilter /
OpenSessionInViewInterceptor .
Furthermore, some operations just make sense within transactions,
for example: contains, evict, lock,
flush, clear.
Defines
HibernateTemplate's data access methods that mirror various Session methods. Users are strongly encouraged to read the HibernateSessionjavadocs for details on the semantics of those methods.Note that operations that return an Iterator (i.e.
iterate(..)) are supposed to be used within Spring-driven or JTA-driven transactions (with HibernateTransactionManager , JtaTransactionManager , or EJB CMT). Else, theIteratorwon't be able to read results from its ResultSet anymore, as the underlying HibernateSessionwill already have been closed.Note that lazy loading will just work with an open Hibernate
Session, either within a transaction or within OpenSessionInViewFilter / OpenSessionInViewInterceptor . Furthermore, some operations just make sense within transactions, for example:contains,evict,lock,flush,clear.