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
emf
Fields 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 TypeMethodDescriptionvoid
Does nothing - transactions are not used.getTransaction
(jakarta.persistence.EntityManager em) Transactions are not used - always returnsnull
.void
Does 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
-Properties
for provider configuration.
-
EMFProviderNoTransactions
Creates new EMF provider with specified persistence unit name.- Parameters:
persistenceUnitName
-String
name of persistence unit.
-
-
Method Details
-
getTransaction
Transactions are not used - always returnsnull
.- Specified by:
getTransaction
in interfaceEMFProviderInterface
- Overrides:
getTransaction
in classEMFProviderLMT
- Parameters:
em
-EntityManager
needed if joining to existing transaction or starting transaction locally.- Returns:
Object
always 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:
commitTransaction
in interfaceEMFProviderInterface
- Overrides:
commitTransaction
in classEMFProviderLMT
- Parameters:
tx
-Object
transaction to be commited.- Throws:
Exception
- occured while committing transaction.
-
rollbackTransaction
Does nothing - transactions are not used.- Specified by:
rollbackTransaction
in interfaceEMFProviderInterface
- Overrides:
rollbackTransaction
in classEMFProviderLMT
- Parameters:
tx
-Object
transaction to be rolled back.
-