public class EMFProviderNoTransactions extends EMFProviderLMT
EntityManagerFactory
is created in static initialization block and used to create EntityManager
objects.emf
ENTITY_MANAGER, ENTITY_MANAGER_FACTORY, JPA_ENTITY_MANAGER, JPA_ENTITY_MANAGER_FACTORY, JPA_PERSISTENCE_UNIT_NAME, JPA_TRANSACTION, PERSISTENCE_UNIT_NAME, TRANSACTION
Constructor and Description |
---|
EMFProviderNoTransactions() Creates new EMF provider. |
EMFProviderNoTransactions(java.util.Properties config) Creates new EMF provider. |
EMFProviderNoTransactions(java.lang.String persistenceUnitName) Creates new EMF provider with specified persistence unit name. |
Modifier and Type | Method and Description |
---|---|
void | commitTransaction(java.lang.Object tx) Does nothing - transactions are not used. |
java.lang.Object | getTransaction(javax.persistence.EntityManager em) Transactions are not used - always returns null . |
void | rollbackTransaction(java.lang.Object tx) Does nothing - transactions are not used. |
get, getEntityManager, returnEntityManager
public EMFProviderNoTransactions()
public EMFProviderNoTransactions(java.util.Properties config)
config
- Properties
for provider configuration.public EMFProviderNoTransactions(java.lang.String persistenceUnitName)
persistenceUnitName
- String
name of persistence unit.public java.lang.Object getTransaction(javax.persistence.EntityManager em) throws java.lang.Exception
null
.getTransaction
in interface EMFProviderInterface
getTransaction
in class EMFProviderLMT
em
- EntityManager
needed if joining to existing transaction or starting transaction locally.Object
always returns null
.javax.persistence.PersistenceException
- if unable to acquire or open transaction.java.lang.Exception
- if unable to acquire or open transaction.public void commitTransaction(java.lang.Object tx) throws java.lang.Exception
commitTransaction
in interface EMFProviderInterface
commitTransaction
in class EMFProviderLMT
tx
- Object
transaction to be commited.java.lang.Exception
- occured while committing transaction.public void rollbackTransaction(java.lang.Object tx)
rollbackTransaction
in interface EMFProviderInterface
rollbackTransaction
in class EMFProviderLMT
tx
- Object
transaction to be rolled back.