April 05
Prof. Ismael H. F. Santos -  ismael@tecgraf.puc-rio.br                                                          2
Spring DAO: Hibernate
nManages Hibernate sessions
nNo more custom ThreadLocal sessions
nSessions are managed within Spring transaction management
nWorks with JTA if desired
nWorks within EJB container with CMT if desired
nHibernateTemplate makes common operations easy
nSimpler, consistent exception handling
nMany operations become one-liners
nLess, simpler, code compared to using Hibernate alone
nPortability: Switch between Hibernate, JDO and other transparent persistence technologies without changing DAO interfaces
nCan even switch to JDBC where transparent update is not implied
nMixed use of Hibernate and JDBC within the same transaction
n
Gavin King now believes Hibernate should have opted for unchecked exceptions

TopLink, JDO

JDBC, Hibernate, iBATIS