Package com.isomorphic.jpa

# Class EMFProviderNoTransactions

java.lang.Object
com.isomorphic.jpa.EMFProviderLMT
com.isomorphic.jpa.EMFProviderNoTransactions

All Implemented Interfaces:
  `EMFProviderInterface`

public class EMFProviderNoTransactions extends EMFProviderLMT
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

  Constructors
  Constructor
  Description
  `EMFProviderNoTransactions()`
  Creates 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 Type
  Method
  Description
  `void`
  `commitTransaction(Object tx)`
  Does nothing - transactions are not used.
  `Object`
  `getTransaction(jakarta.persistence.EntityManager em)`
  Transactions are not used - always returns `null`.
  `void`
  `rollbackTransaction(Object tx)`
  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

    public EMFProviderNoTransactions(Properties config)
    Creates new EMF provider. Name of persistence unit is read from provided persistenceUnitName property.
    Parameters:
      `config` - `Properties` for provider configuration.

  - ### EMFProviderNoTransactions

    public EMFProviderNoTransactions(String persistenceUnitName)
    Creates new EMF provider with specified persistence unit name.
    Parameters:
      `persistenceUnitName` - `String` name of persistence unit.

- ## Method Details

  - ### getTransaction

    public Object getTransaction(jakarta.persistence.EntityManager em) throws Exception
    Transactions are not used - always returns `null`.
    Specified by:
      `getTransaction` in interface `EMFProviderInterface`
    Overrides:
      `getTransaction` in class `EMFProviderLMT`
    Parameters:
      `em` - `EntityManager` needed if joining to existing transaction or starting transaction locally.
    Returns:
      `Object` always returns `null`.
    Throws:
      `jakarta.persistence.PersistenceException` - if unable to acquire or open transaction.
      `Exception` - if unable to acquire or open transaction.

  - ### commitTransaction

    public void commitTransaction(Object tx) throws Exception
    Does nothing - transactions are not used.
    Specified by:
      `commitTransaction` in interface `EMFProviderInterface`
    Overrides:
      `commitTransaction` in class `EMFProviderLMT`
    Parameters:
      `tx` - `Object` transaction to be commited.
    Throws:
      `Exception` - occured while committing transaction.

  - ### rollbackTransaction

    public void rollbackTransaction(Object tx)
    Does nothing - transactions are not used.
    Specified by:
      `rollbackTransaction` in interface `EMFProviderInterface`
    Overrides:
      `rollbackTransaction` in class `EMFProviderLMT`
    Parameters:
      `tx` - `Object` transaction to be rolled back.