Hibernate parts of AVM now based on Spring PlatformTransactionManager

abstraction.  Configurations to match.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3286 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Britt Park
2006-07-06 02:08:21 +00:00
parent c54b07f607
commit cdef918e07
8 changed files with 183 additions and 65 deletions

View File

@@ -0,0 +1,42 @@
/**
*
*/
package org.alfresco.repo.avm.hibernate;
import java.sql.SQLException;
import org.hibernate.HibernateException;
import org.hibernate.Session;
import org.springframework.orm.hibernate3.HibernateCallback;
/**
* This is a wrapper around HibernateTxnCallback implementation.
* @author britt
*/
public class HibernateCallbackWrapper implements HibernateCallback
{
/**
* The HibernateTxnCallback to execute.
*/
private HibernateTxnCallback fCallback;
/**
* Make one up.
* @param callback
*/
public HibernateCallbackWrapper(HibernateTxnCallback callback)
{
fCallback = callback;
}
/**
* Call the HibernateTxnCallback internally.
* @param session The Hibernate Session.
*/
public Object doInHibernate(Session session) throws HibernateException,
SQLException
{
fCallback.perform(session);
return null;
}
}