Convenient super class for Hibernate-based data access objects.
Requires a {@link org.hibernate.SessionFactory} to be set, providing a{@link org.springframework.orm.hibernate3.HibernateTemplate} based on it tosubclasses through the {@link #getHibernateTemplate()} method.Can alternatively be initialized directly with a HibernateTemplate, in order to reuse the latter's settings such as the SessionFactory, exception translator, flush mode, etc.
This base class is mainly intended for HibernateTemplate usage but can also be used when working with a Hibernate Session directly, for example when relying on transactional Sessions. Convenience {@link #getSession}and {@link #releaseSession} methods are provided for that usage style.
This class will create its own HibernateTemplate instance if a SessionFactory is passed in. The "allowCreate" flag on that HibernateTemplate will be "true" by default. A custom HibernateTemplate instance can be used through overriding {@link #createHibernateTemplate}.
@author Juergen Hoeller
@since 1.2
@see #setSessionFactory
@see #getHibernateTemplate
@see org.springframework.orm.hibernate3.HibernateTemplate