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.
JpaTransactionManager
,
EntityManagerFactoryUtils
Constructor and Description |
---|
EntityManagerHolder(EntityManager entityManager) |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clear the transactional state of this resource holder.
|
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, setTimeoutInMillis, setTimeoutInSeconds, unbound
public EntityManagerHolder(@Nullable EntityManager entityManager)
public EntityManager getEntityManager()
protected void setTransactionActive(boolean transactionActive)
protected boolean isTransactionActive()
protected void setSavepointManager(@Nullable SavepointManager savepointManager)
@Nullable protected SavepointManager getSavepointManager()
public void clear()
ResourceHolderSupport
clear
in class ResourceHolderSupport