com.isomorphic.jpa

## Interface EMFProviderInterface

- All Known Implementing Classes:
    EMFProviderBMT, EMFProviderCMT, EMFProviderLMT, EMFProviderNoTransactions, EMFProviderSpring

      public interface EMFProviderInterface

  Interface used to provide specific implementation of `EntityManager` and transaction acquiring and handling.

  Implementation of this interface should provide at least two constructors:
  1. default constructor - will be used if implementation is used as default EMF provider
  2. constructor with single parameter of type `Properties` - will be used if implementation is used as additional named EMF provider

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `ENTITY_MANAGER` Name of sub property for resource reference to entity manager.
    `static java.lang.String` | `ENTITY_MANAGER_FACTORY` Name of sub property for resource reference to entity manager factory.
    `static java.lang.String` | `JPA_ENTITY_MANAGER` Name of property for resource reference to entity manager.
    `static java.lang.String` | `JPA_ENTITY_MANAGER_FACTORY` Name of property for resource reference to entity manager factory.
    `static java.lang.String` | `JPA_PERSISTENCE_UNIT_NAME` Name of property for persistence unit name.
    `static java.lang.String` | `JPA_TRANSACTION` Name of property for resource reference to transaction or transaction manager.
    `static java.lang.String` | `PERSISTENCE_UNIT_NAME` Name of sub property for persistence unit name.
    `static java.lang.String` | `TRANSACTION` Name of sub property for resource reference to transaction or transaction manager.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `commitTransaction(java.lang.Object tx)` Commits specified transaction.
    `javax.persistence.EntityManagerFactory` | `get()` Returns `EntityManagerFactory`.
    `javax.persistence.EntityManager` | `getEntityManager()` Returns `EntityManager` for persistence operations.
    `java.lang.Object` | `getTransaction(javax.persistence.EntityManager em)` Returns started transaction.
    `void` | `returnEntityManager(javax.persistence.EntityManager em)` Closes `EntityManager`.
    `void` | `rollbackTransaction(java.lang.Object tx)` Rolls back specified transaction.

- - ### Field Detail

    - #### PERSISTENCE_UNIT_NAME

          static final java.lang.String PERSISTENCE_UNIT_NAME

      Name of sub property for persistence unit name.
      See Also:
        Constant Field Values

    - #### JPA_PERSISTENCE_UNIT_NAME

          static final java.lang.String JPA_PERSISTENCE_UNIT_NAME

      Name of property for persistence unit name.
      See Also:
        Constant Field Values

    - #### ENTITY_MANAGER

          static final java.lang.String ENTITY_MANAGER

      Name of sub property for resource reference to entity manager.
      See Also:
        Constant Field Values

    - #### JPA_ENTITY_MANAGER

          static final java.lang.String JPA_ENTITY_MANAGER

      Name of property for resource reference to entity manager.
      See Also:
        Constant Field Values

    - #### ENTITY_MANAGER_FACTORY

          static final java.lang.String ENTITY_MANAGER_FACTORY

      Name of sub property for resource reference to entity manager factory.
      See Also:
        Constant Field Values

    - #### JPA_ENTITY_MANAGER_FACTORY

          static final java.lang.String JPA_ENTITY_MANAGER_FACTORY

      Name of property for resource reference to entity manager factory.
      See Also:
        Constant Field Values

    - #### TRANSACTION

          static final java.lang.String TRANSACTION

      Name of sub property for resource reference to transaction or transaction manager.
      See Also:
        Constant Field Values

    - #### JPA_TRANSACTION

          static final java.lang.String JPA_TRANSACTION

      Name of property for resource reference to transaction or transaction manager.
      See Also:
        Constant Field Values

  - ### Method Detail

    - #### get

          javax.persistence.EntityManagerFactory get()

      Returns `EntityManagerFactory`.
      Returns:
        `EntityManagerFactory`.

    - #### getEntityManager

          javax.persistence.EntityManager getEntityManager()
                                                    throws javax.persistence.PersistenceException

      Returns `EntityManager` for persistence operations.

      Returns:
        `EntityManager` for persistence operations.
      Throws:
        `javax.persistence.PersistenceException` - if unable to acquire `EntityManager`.

    - #### returnEntityManager

          void returnEntityManager(javax.persistence.EntityManager em)

      Closes `EntityManager`.

      Parameters:
        `em` - `EntityManager` which should be closed.

    - #### getTransaction

          java.lang.Object getTransaction(javax.persistence.EntityManager em)
                                   throws java.lang.Exception

      Returns started transaction.

      Parameters:
        `em` - `EntityManager` needed if joining to existing transaction or starting transaction locally.
      Returns:
        `Object` Already started transaction for persistence operations.
      Throws:
        `java.lang.Exception` - if unable to acquire or open transaction.

    - #### commitTransaction

          void commitTransaction(java.lang.Object tx)
                          throws java.lang.Exception

      Commits specified transaction.

      Parameters:
        `tx` - `Object` transaction to be commited.
      Throws:
        `java.lang.Exception` - occured while committing transaction.

    - #### rollbackTransaction

          void rollbackTransaction(java.lang.Object tx)

      Rolls back specified transaction.

      Parameters:
        `tx` - `Object` transaction to be rolled back.