Package com.isomorphic.jpa
Class EMFProviderNoTransactions
java.lang.Object
com.isomorphic.jpa.EMFProviderLMT
com.isomorphic.jpa.EMFProviderNoTransactions
- All Implemented Interfaces:
EMFProviderInterface
EMF provider for Google Application Engine mode without transactions usage.
Name of persistence unit can be read from jpa.persistenceUnitName property. EntityManagerFactory is created in static initialization block and used to create EntityManager objects.
-
Field Summary
Fields inherited from class com.isomorphic.jpa.EMFProviderLMT
emfFields inherited from interface com.isomorphic.jpa.EMFProviderInterface
ENTITY_MANAGER, ENTITY_MANAGER_FACTORY, JPA_ENTITY_MANAGER, JPA_ENTITY_MANAGER_FACTORY, JPA_PERSISTENCE_UNIT_NAME, JPA_TRANSACTION, PERSISTENCE_UNIT_NAME, TRANSACTION -
Constructor Summary
ConstructorsConstructorDescriptionCreates new EMF provider.EMFProviderNoTransactions(String persistenceUnitName) Creates new EMF provider with specified persistence unit name.EMFProviderNoTransactions(Properties config) Creates new EMF provider. -
Method Summary
Modifier and TypeMethodDescriptionvoidDoes nothing - transactions are not used.getTransaction(jakarta.persistence.EntityManager em) Transactions are not used - always returnsnull.voidDoes nothing - transactions are not used.Methods inherited from class com.isomorphic.jpa.EMFProviderLMT
get, getEntityManager, returnEntityManager
-
Constructor Details
-
EMFProviderNoTransactions
public EMFProviderNoTransactions()Creates new EMF provider. Name of persistence unit is read from jpa.persistenceUnitName property. -
EMFProviderNoTransactions
Creates new EMF provider. Name of persistence unit is read from provided persistenceUnitName property.- Parameters:
config-Propertiesfor provider configuration.
-
EMFProviderNoTransactions
Creates new EMF provider with specified persistence unit name.- Parameters:
persistenceUnitName-Stringname of persistence unit.
-
-
Method Details
-
getTransaction
Transactions are not used - always returnsnull.- Specified by:
getTransactionin interfaceEMFProviderInterface- Overrides:
getTransactionin classEMFProviderLMT- Parameters:
em-EntityManagerneeded if joining to existing transaction or starting transaction locally.- Returns:
Objectalways returnsnull.- Throws:
jakarta.persistence.PersistenceException- if unable to acquire or open transaction.Exception- if unable to acquire or open transaction.
-
commitTransaction
Does nothing - transactions are not used.- Specified by:
commitTransactionin interfaceEMFProviderInterface- Overrides:
commitTransactionin classEMFProviderLMT- Parameters:
tx-Objecttransaction to be commited.- Throws:
Exception- occured while committing transaction.
-
rollbackTransaction
Does nothing - transactions are not used.- Specified by:
rollbackTransactionin interfaceEMFProviderInterface- Overrides:
rollbackTransactionin classEMFProviderLMT- Parameters:
tx-Objecttransaction to be rolled back.
-