public abstract class JPATransactionalMapper extends TransactionalMapper
Mapper.Transaction<T>, Mapper.VoidTransaction| Modifier and Type | Field and Description |
|---|---|
protected javax.persistence.EntityManager |
entityManager |
protected javax.persistence.EntityManagerFactory |
entityManagerFactory |
| Constructor and Description |
|---|
JPATransactionalMapper(javax.persistence.EntityManagerFactory entityManagerFactory) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
begin()
Begin transaction
|
protected void |
commit()
Commit the Transaction and close the EntityManager
|
void |
endRequest()
Close open
EntityManager |
javax.persistence.EntityManager |
getEntityManager()
Return the currently used
EntityManager or a new one if none exists. |
protected void |
rollback()
Rollback transaction
|
executeprotected javax.persistence.EntityManagerFactory entityManagerFactory
protected javax.persistence.EntityManager entityManager
public JPATransactionalMapper(javax.persistence.EntityManagerFactory entityManagerFactory)
public javax.persistence.EntityManager getEntityManager()
EntityManager or a new one if none exists.protected void begin()
throws MailboxException
TransactionalMapperbegin in class TransactionalMapperMailboxExceptionTransactionalMapper.begin()protected void commit()
throws MailboxException
commit in class TransactionalMapperMailboxExceptionprotected void rollback()
throws MailboxException
TransactionalMapperrollback in class TransactionalMapperMailboxExceptionTransactionalMapper.rollback()public void endRequest()
EntityManagerCopyright © 2010-2012 The Apache Software Foundation. All Rights Reserved.