public class TransactionUtil extends Object
Constructor and Description |
---|
TransactionUtil() |
Modifier and Type | Method and Description |
---|---|
static javax.persistence.EntityManager |
getOrCreateTransactionScopedEntityManager(javax.persistence.EntityManagerFactory emf,
String scopedPuName,
Map properties)
Get current PC or create a Transactional entity manager.
|
static TransactionManager |
getTransactionManager() |
static javax.persistence.EntityManager |
getTransactionScopedEntityManager(String puScopedName)
Get current persistence context.
|
static TransactionSynchronizationRegistry |
getTransactionSynchronizationRegistry() |
static boolean |
isInTx() |
static void |
registerExtendedUnderlyingWithTransaction(String scopedPuName,
javax.persistence.EntityManager xpc,
javax.persistence.EntityManager underlyingEntityManager)
Register the specified entity manager (persistence context) with the current transaction.
|
static void |
setTransactionManager(TransactionManager tm) |
static void |
setTransactionSynchronizationRegistry(TransactionSynchronizationRegistry transactionSynchronizationRegistry) |
public static void setTransactionManager(TransactionManager tm)
public static TransactionManager getTransactionManager()
public static void setTransactionSynchronizationRegistry(TransactionSynchronizationRegistry transactionSynchronizationRegistry)
public static boolean isInTx()
public static void registerExtendedUnderlyingWithTransaction(String scopedPuName, javax.persistence.EntityManager xpc, javax.persistence.EntityManager underlyingEntityManager)
scopedPuName
- is the fully (application deployment) scoped name of persistence unitxpc
- is the entity manager (a org.jboss.as.jpa class) to registerunderlyingEntityManager
- is the underlying entity manager obtained from the persistence providerpublic static javax.persistence.EntityManager getTransactionScopedEntityManager(String puScopedName)
puScopedName
- public static javax.persistence.EntityManager getOrCreateTransactionScopedEntityManager(javax.persistence.EntityManagerFactory emf, String scopedPuName, Map properties)
emf
- scopedPuName
- properties
- public static TransactionSynchronizationRegistry getTransactionSynchronizationRegistry()
Copyright © 2013 JBoss, a division of Red Hat, Inc.. All rights reserved.