With Spring, you do not need to implement code for obtaining
Session objects, starting and committing transactions, and handling Hibernate exceptions. Instead, you use a
HibernateTemplate instance to delegate persistence calls to Hibernate, without direct interaction with Hibernate.
Here are some benefits of using Spring in the persistence layer, instead of using direct interaction with Hibernate:
HibernateTemplateobject interacts with Hibernate. This object removes the boilerplate code from DAO implementations.
HibernateTemplate'smethods throws the generic
DataAccessExceptionexception instead of
HibernateException(a Hibernate-specific exception).