Two Laptop Bag
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
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Reply Bookmark "What is the use of Hibernate Callback interface?" Watch "What is the use of Hibernate Callback interface?" New topic
Author

What is the use of Hibernate Callback interface?

Vamsi Sigarambotla
Greenhorn

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
Bartender

Joined: Mar 07, 2010
Posts: 1282

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
https://jira.springsource.org/browse/SPR-8096

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: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: What is the use of Hibernate Callback interface?
 
Similar Threads
polymorphic persistence
iBatis in Action: Can I persist my POJOs with it?
Interface and abstract class
doubt about marker Interface
Hibernate vs JPA?