org.apache.james.mailbox.jpa
Class JPATransactionalMapper
java.lang.Object
org.apache.james.mailbox.store.transaction.TransactionalMapper
org.apache.james.mailbox.jpa.JPATransactionalMapper
- All Implemented Interfaces:
- Mapper
- Direct Known Subclasses:
- JPAMailboxMapper, JPAMessageMapper, JPASubscriptionMapper
public abstract class JPATransactionalMapper
- extends TransactionalMapper
JPA implementation of TransactionMapper. This class is not thread-safe!
|
Method Summary |
protected void |
begin()
|
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()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
entityManagerFactory
protected javax.persistence.EntityManagerFactory entityManagerFactory
entityManager
protected javax.persistence.EntityManager entityManager
JPATransactionalMapper
public JPATransactionalMapper(javax.persistence.EntityManagerFactory entityManagerFactory)
getEntityManager
public javax.persistence.EntityManager getEntityManager()
- Return the currently used
EntityManager or a new one if none exists.
- Returns:
- entitymanger
begin
protected void begin()
throws MailboxException
- Specified by:
begin in class TransactionalMapper
- Throws:
MailboxException
commit
protected void commit()
throws MailboxException
- Commit the Transaction and close the EntityManager
- Specified by:
commit in class TransactionalMapper
- Throws:
MailboxException
rollback
protected void rollback()
throws MailboxException
- Specified by:
rollback in class TransactionalMapper
- Throws:
MailboxException
endRequest
public void endRequest()
- Close open
EntityManager
Copyright © 2010-2011 The Apache Software Foundation. All Rights Reserved.