public class EntityManagerHolder extends ResourceHolderSupport
EntityManager
.
JpaTransactionManager
binds instances of this class to the thread,
for a given EntityManagerFactory
.
Also serves as a base class for SessionHolder
,
as of 5.1.
Note: This is an SPI class, not intended to be used by applications.
Constructor and Description |
---|
EntityManagerHolder(javax.persistence.EntityManager entityManager)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clear the transactional state of this resource holder.
|
javax.persistence.EntityManager |
getEntityManager() |
protected SavepointManager |
getSavepointManager() |
protected boolean |
isTransactionActive() |
protected void |
setSavepointManager(SavepointManager savepointManager) |
protected void |
setTransactionActive(boolean transactionActive) |
getDeadline, getTimeToLiveInMillis, getTimeToLiveInSeconds, hasTimeout, isOpen, isRollbackOnly, isSynchronizedWithTransaction, isVoid, released, requested, reset, resetRollbackOnly, setRollbackOnly, setSynchronizedWithTransaction, setTimeout, setTimeoutInMillis, unbound
public EntityManagerHolder(@Nullable javax.persistence.EntityManager entityManager)
entityManager
- The entity manager@NonNull public javax.persistence.EntityManager getEntityManager()
protected void setTransactionActive(boolean transactionActive)
transactionActive
- Sets the transaction as active.protected boolean isTransactionActive()
protected void setSavepointManager(@Nullable SavepointManager savepointManager)
savepointManager
- Sets the save point manager@Nullable protected SavepointManager getSavepointManager()
public void clear()
ResourceHolderSupport
clear
in class ResourceHolderSupport