Package org.nuxeo.ecm.core.persistence
Class PersistenceProvider
- java.lang.Object
-
- org.nuxeo.ecm.core.persistence.PersistenceProvider
-
public class PersistenceProvider extends Object
- Author:
- Stephane Lacoin [aka matic]
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
PersistenceProvider.RunCallback<T>
static interface
PersistenceProvider.RunVoid
-
Field Summary
Fields Modifier and Type Field Description protected javax.persistence.EntityManagerFactory
emf
protected EntityManagerFactoryProvider
emfProvider
protected static Log
log
-
Constructor Summary
Constructors Constructor Description PersistenceProvider(EntityManagerFactoryProvider emfProvider)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.persistence.EntityManager
acquireEntityManager()
javax.persistence.EntityManager
acquireEntityManagerWithActiveTransaction()
void
closePersistenceUnit()
protected javax.persistence.EntityManager
doAcquireEntityManager()
protected void
doBegin(javax.persistence.EntityManager em)
protected void
doCommit(javax.persistence.EntityManager em)
protected void
doRollback(javax.persistence.EntityManager em)
protected javax.persistence.EntityTransaction
getTransaction(javax.persistence.EntityManager em)
void
openPersistenceUnit()
protected void
releaseEntityManager(javax.persistence.EntityManager em)
void
releaseEntityManagerWithRollback(javax.persistence.EntityManager em)
<T> T
run(Boolean needActiveSession, PersistenceProvider.RunCallback<T> callback)
void
run(Boolean needActiveSession, PersistenceProvider.RunVoid callback)
-
-
-
Field Detail
-
log
protected static final Log log
-
emf
protected volatile javax.persistence.EntityManagerFactory emf
-
emfProvider
protected final EntityManagerFactoryProvider emfProvider
-
-
Constructor Detail
-
PersistenceProvider
public PersistenceProvider(EntityManagerFactoryProvider emfProvider)
-
-
Method Detail
-
openPersistenceUnit
public void openPersistenceUnit()
-
closePersistenceUnit
public void closePersistenceUnit()
-
doAcquireEntityManager
protected javax.persistence.EntityManager doAcquireEntityManager()
-
getTransaction
protected javax.persistence.EntityTransaction getTransaction(javax.persistence.EntityManager em)
-
acquireEntityManager
public javax.persistence.EntityManager acquireEntityManager()
-
acquireEntityManagerWithActiveTransaction
public javax.persistence.EntityManager acquireEntityManagerWithActiveTransaction()
-
doBegin
protected void doBegin(javax.persistence.EntityManager em)
-
doCommit
protected void doCommit(javax.persistence.EntityManager em)
-
doRollback
protected void doRollback(javax.persistence.EntityManager em)
-
releaseEntityManager
protected void releaseEntityManager(javax.persistence.EntityManager em)
-
releaseEntityManagerWithRollback
public void releaseEntityManagerWithRollback(javax.persistence.EntityManager em)
-
run
public <T> T run(Boolean needActiveSession, PersistenceProvider.RunCallback<T> callback)
-
run
public void run(Boolean needActiveSession, PersistenceProvider.RunVoid callback)
-
-