Integration of Hibernate with Spring
Spring is a powerful middle tier framework which has got good support for Hibernate. In Hibernate we perform the operations like save,update,merge etc. using session. If we are using spring we can perform all these and many more tasks using Hibernate Template. In order to use Hibernate template(There are other ways too.I personally feel this is the simplest way) we need to define an interface containing all the methods of the DAO class. The DAO class must implement this interface and extends HibernateDaoSupport. By doing this we can perform all the operations. Advantage of using Hibernate Template is that it performs the session and transaction management by itself and we don’t have to implicitly open and close the session or begin and commit the transaction.
-
Archives
- February 2012 (1)
- July 2009 (1)
- June 2009 (1)
- May 2009 (7)
-
Categories
-
RSS
Entries RSS
Comments RSS