Package org.itracker.persistence.dao

This package contains all Data Access Object (XxxDAO) interfaces along with their Hibernate implementations (XxxDAOImpl).

DAO interfaces are implementation independent : all DAO methods throw org.springframework.dao.DataAccessException instead of implementation-specific exceptions like java.sql.SQLException or org.hibernate.HibernateException.
Since this is a general convention, DAO methods don't need to specify it in their throws clause.

DAO implementations that don't use Spring's HibernateTemplate and callbacks must explicitly catch HibernateExceptions and convert them to DataAccessExceptions by wrapping all Hibernate code that can throw such exceptions like this:

      try {
          getSession()...
      } catch (HibernateException ex) {
          throw convertHibernateAccessException(ex);
      }
 

Session management (opening and closing the Hibernate session) is handled automatically by the HibernateTransactionManager or an AOP interceptor, if a DAO method is invoked outside the scope of a transaction.

Since:
3.0
Skip navigation links

Copyright © 2002–2019 itracker. All rights reserved.