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
|
execute
protected 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
TransactionalMapper
begin
in class TransactionalMapper
MailboxException
TransactionalMapper.begin()
protected void commit() throws MailboxException
commit
in class TransactionalMapper
MailboxException
protected void rollback() throws MailboxException
TransactionalMapper
rollback
in class TransactionalMapper
MailboxException
TransactionalMapper.rollback()
public void endRequest()
EntityManager
Copyright © 2010-2012 The Apache Software Foundation. All Rights Reserved.