|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.cayenne.jpa.ResourceLocalEntityManager
org.apache.cayenne.jpa.JtaEntityManager
public class JtaEntityManager
An EntityManager that can participate in JTA transactions.
Field Summary | |
---|---|
protected Object |
currentTxKey
|
Fields inherited from class org.apache.cayenne.jpa.ResourceLocalEntityManager |
---|
context, factory, flushMode, open, transaction |
Constructor Summary | |
---|---|
JtaEntityManager(ObjectContext context,
JtaEntityManagerFactory factory)
|
Method Summary | ||
---|---|---|
protected void |
checkTransaction()
|
|
void |
flush()
Synchronize the persistence context to the underlying database. |
|
EntityTransaction |
getTransaction()
Return the resource-level transaction object. |
|
void |
joinTransaction()
Indicates to the EntityManager that a JTA transaction is active. |
|
|
merge(T entity)
Merge the state of the given entity into the current persistence context. |
|
void |
persist(Object entity)
Make an instance managed and persistent. |
|
void |
refresh(Object entity)
Refresh the state of the instance from the database, overwriting changes made to the entity, if any. |
|
void |
remove(Object entity)
Remove the entity instance. |
Methods inherited from class org.apache.cayenne.jpa.ResourceLocalEntityManager |
---|
checkAttached, checkClosed, checkNotRemoved, clear, close, contains, createNamedQuery, createNativeQuery, createNativeQuery, createNativeQuery, createQuery, find, getChannel, getDelegate, getFactory, getFlushMode, getReference, isOpen, lock, setFlushMode |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Object currentTxKey
Constructor Detail |
---|
public JtaEntityManager(ObjectContext context, JtaEntityManagerFactory factory)
Method Detail |
---|
public EntityTransaction getTransaction()
ResourceLocalEntityManager
getTransaction
in class ResourceLocalEntityManager
IllegalStateException,
- as this entity manager is of JTA kind.public void joinTransaction()
joinTransaction
in class ResourceLocalEntityManager
TransactionRequiredException
- if there is no transaction.public void persist(Object entity)
ResourceLocalEntityManager
persist
in class ResourceLocalEntityManager
entity
- an object to be made persistent
TransactionRequiredException
- if there is no transaction.public <T> T merge(T entity)
ResourceLocalEntityManager
merge
in class ResourceLocalEntityManager
TransactionRequiredException
- if there is no transaction.public void remove(Object entity)
ResourceLocalEntityManager
remove
in class ResourceLocalEntityManager
TransactionRequiredException
- if there is no transaction.public void refresh(Object entity)
ResourceLocalEntityManager
refresh
in class ResourceLocalEntityManager
TransactionRequiredException
- if there is no transaction.public void flush()
ResourceLocalEntityManager
flush
in class ResourceLocalEntityManager
TransactionRequiredException
- if there is no transaction.protected void checkTransaction() throws TransactionRequiredException
TransactionRequiredException
- if there is no transaction in progress.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |