File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Object Relational Mapping and the fly likes What is the use of Hibernate Callback interface? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "What is the use of Hibernate Callback interface?" Watch "What is the use of Hibernate Callback interface?" New topic

What is the use of Hibernate Callback interface?

Vamsi Sigarambotla

Joined: Apr 22, 2012
Posts: 4
Can someone please explain what is the use of HibernateCallBack interface?

I have googled something related to this and understood that it will notify the changes made to the persistent objects. Is my understanding correct? Please someone clearly explain me what it does and when to use this interface. I have gone through the internal implementation of hibernate template and observed all the operations performed on persistent objects like save,delete, load etc are using this interface.

A good explanation is appreciable.

Thanks in advance.
Bill Gorder

Joined: Mar 07, 2010
Posts: 1682

I know this does not answer your question directly but don't use HibernateTemplate/HibernateDaoSupport it isn't recommended use the SessionFactory directly.

As a matter of fact as of hibernate 4 its not only not recommended but it has been removed altogether. See the below Jira

Eliminate HibernateTemplate and friends (e.g. HibernateCallback in favor of Spring's more modern 'Native Hibernate DAO' approach

Unless you are using a very old version of hibernate in a legacy application it should be avoided.

[How To Ask Questions][Read before you PM me]
I agree. Here's the link:
subject: What is the use of Hibernate Callback interface?
It's not a secret anymore!