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 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.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    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.

    - ### Methods inherited from class com.isomorphic.jpa.EMFProviderLMT

      `get, getEntityManager, returnEntityManager`

- - ### Constructor Detail

    - #### EMFProviderNoTransactions

          public EMFProviderNoTransactions()

      Creates new EMF provider. Name of persistence unit is read from jpa.persistenceUnitName property.

    - #### EMFProviderNoTransactions

          public EMFProviderNoTransactions(java.util.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(java.lang.String persistenceUnitName)

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

  - ### Method Detail

    - #### getTransaction

          public java.lang.Object getTransaction(javax.persistence.EntityManager em)
                                          throws java.lang.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:
        `javax.persistence.PersistenceException` - if unable to acquire or open transaction.
        `java.lang.Exception` - if unable to acquire or open transaction.

    - #### commitTransaction

          public void commitTransaction(java.lang.Object tx)
                                 throws java.lang.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:
        `java.lang.Exception` - occured while committing transaction.

    - #### rollbackTransaction

          public void rollbackTransaction(java.lang.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.