public abstract class JPAUnitOfWork extends Object implements UnitOfWork, Closeable
| Constructor and Description |
|---|
JPAUnitOfWork(javax.persistence.EntityManagerFactory factory) |
| Modifier and Type | Method and Description |
|---|---|
void |
cancel()
Mark the current resource transaction so that the only
possible outcome of the transaction is for the transaction
to be rolled back.
|
void |
close() |
void |
configure(javax.persistence.FlushModeType flushModeType,
javax.persistence.SynchronizationType synchronizationType,
Map<?,?> map) |
void |
end()
Commit the current resource transaction, writing any
unflushed changes to the database.
|
protected javax.persistence.EntityManager |
getEntityManager() |
void |
start() |
public JPAUnitOfWork(javax.persistence.EntityManagerFactory factory)
public void configure(javax.persistence.FlushModeType flushModeType,
javax.persistence.SynchronizationType synchronizationType,
Map<?,?> map)
public void start()
start in interface UnitOfWorkpublic void end()
end in interface UnitOfWorkIllegalStateException - if isActive() is falsejavax.persistence.RollbackException - if the commit failspublic void cancel()
cancel in interface UnitOfWorkIllegalStateException - if isActive() is falsepublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionprotected javax.persistence.EntityManager getEntityManager()
Copyright © 2019. All rights reserved.