public class PersistenceProvider extends Object
Modifier and Type | Class and Description |
---|---|
static interface |
PersistenceProvider.RunCallback<T> |
static interface |
PersistenceProvider.RunVoid |
Modifier and Type | Field and Description |
---|---|
protected javax.persistence.EntityManagerFactory |
emf |
protected EntityManagerFactoryProvider |
emfProvider |
protected static org.apache.commons.logging.Log |
log |
Constructor and Description |
---|
PersistenceProvider(EntityManagerFactoryProvider emfProvider) |
Modifier and Type | Method and 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) |
protected static final org.apache.commons.logging.Log log
protected javax.persistence.EntityManagerFactory emf
protected final EntityManagerFactoryProvider emfProvider
public PersistenceProvider(EntityManagerFactoryProvider emfProvider)
public void openPersistenceUnit()
public void closePersistenceUnit()
protected javax.persistence.EntityManager doAcquireEntityManager()
protected javax.persistence.EntityTransaction getTransaction(javax.persistence.EntityManager em)
public javax.persistence.EntityManager acquireEntityManager()
public javax.persistence.EntityManager acquireEntityManagerWithActiveTransaction()
protected void doBegin(javax.persistence.EntityManager em)
protected void doCommit(javax.persistence.EntityManager em)
protected void doRollback(javax.persistence.EntityManager em)
protected void releaseEntityManager(javax.persistence.EntityManager em)
public void releaseEntityManagerWithRollback(javax.persistence.EntityManager em)
public <T> T run(Boolean needActiveSession, PersistenceProvider.RunCallback<T> callback)
public void run(Boolean needActiveSession, PersistenceProvider.RunVoid callback)
Copyright © 2015 Nuxeo SA. All rights reserved.