Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.cayenne.jpa
Class JtaEntityManagerFactory

    java.lang.Object
      org.apache.cayenne.jpa.ResourceLocalEntityManagerFactory
          org.apache.cayenne.jpa.JtaEntityManagerFactory

All Implemented Interfaces:
  javax.persistence.EntityManagerFactory

    public class JtaEntityManagerFactory

extends ResourceLocalEntityManagerFactory

An EntityManagerFactory that registers all EntityManagers that it creates with an active JTA Transaction so that they could flush the object state to the database during commit.

Author:
  Andrus Adamchik

Field Summary
`protected TransactionSynchronizationRegistry` | `transactionRegistry`

Fields inherited from class org.apache.cayenne.jpa.ResourceLocalEntityManagerFactory
`domain, open, provider, unitInfo`

Constructor Summary
`JtaEntityManagerFactory(Provider provider, DataDomain domain, javax.persistence.spi.PersistenceUnitInfo unitInfo)`

Method Summary
`javax.persistence.EntityManager` | `createEntityManager(Map map)` Creates a new resource-local EntityManager with the specified map of properties.
`protected TransactionSynchronizationRegistry` | `getTransactionRegistry()` Returns JTA 11 TransactionSynchronizationRegistry, looking it up via JNDI on first access, and caching it for the following invocations.
`protected boolean` | `isActiveTransaction()` Returns whether there is a JTA transaction in progress.

Methods inherited from class org.apache.cayenne.jpa.ResourceLocalEntityManagerFactory
`close, createEntityManager, createObjectContext, getPersistenceUnitInfo, getProvider, isOpen`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### transactionRegistry

    protected TransactionSynchronizationRegistry transactionRegistry

Constructor Detail

### JtaEntityManagerFactory

    public JtaEntityManagerFactory(Provider provider,
                                   DataDomain domain,
                                   javax.persistence.spi.PersistenceUnitInfo unitInfo)

Method Detail

### getTransactionRegistry

    protected TransactionSynchronizationRegistry getTransactionRegistry()

  Returns JTA 11 TransactionSynchronizationRegistry, looking it up via JNDI on first access, and caching it for the following invocations.

### isActiveTransaction

    protected boolean isActiveTransaction()

  Returns whether there is a JTA transaction in progress.

### createEntityManager

    public javax.persistence.EntityManager createEntityManager(Map map)

  Description copied from class: `ResourceLocalEntityManagerFactory`
  Creates a new resource-local EntityManager with the specified map of properties. Returns a new EntityManager instance every time it is invoked. The `EntityManager.isOpen()` method will return true of the returned instance. Parameter map is ignored as Cayenne provider defines no properties for EntityManager as of now.

  Specified by:
    `createEntityManager` in interface `javax.persistence.EntityManagerFactory`
  Overrides:
    `createEntityManager` in class `ResourceLocalEntityManagerFactory`
  Returns:
    a new EntityManager instance.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2001-2007 Apache Cayenne. All Rights Reserved.