Package com.isomorphic.jpa
Class JPAConnectionHolder
java.lang.Object
com.isomorphic.jpa.JPAConnectionHolder
Holds
EntityManager and current transaction. Instance of this class is used to store connection information in RPCManager while handling Automatic Transactions.-
Method Summary
Modifier and TypeMethodDescriptionjakarta.persistence.EntityManagerReturnsEntityManagerfor this connection.intReturns count of operations executed.Returns current open transaction.voidIncreases operations count by 1.voidsetEntityManager(jakarta.persistence.EntityManager em) Sets newEntityManager.voidsetTransaction(Object tx) Sets new transaction.
-
Method Details
-
getEntityManager
public jakarta.persistence.EntityManager getEntityManager()ReturnsEntityManagerfor this connection.- Returns:
EntityManagerfor this connection.
-
setEntityManager
public void setEntityManager(jakarta.persistence.EntityManager em) Sets newEntityManager.- Parameters:
em-EntityManagernew entity manager.
-
getTransaction
Returns current open transaction.- Returns:
Objectcurrent transaction.
-
setTransaction
Sets new transaction.- Parameters:
tx-Objectnew transaction.
-
getOpCount
public int getOpCount()Returns count of operations executed.- Returns:
intexecuted operations count.
-
increaseOpCount
public void increaseOpCount()Increases operations count by 1.
-