org.apache.openjpa.persistence
Interface OpenJPAEntityManagerFactory

All Superinterfaces:
Closeable, ConnectionRetainModes, EntityManagerFactory, Serializable
All Known Implementing Classes:
EntityManagerFactoryImpl

public interface OpenJPAEntityManagerFactory
extends EntityManagerFactory, ConnectionRetainModes, Closeable, Serializable

Interface implemented by OpenJPA entity manager factories.

Since:
0.4.0
Author:
Abe White

Field Summary
 
Fields inherited from interface org.apache.openjpa.kernel.ConnectionRetainModes
CONN_RETAIN_ALWAYS, CONN_RETAIN_DEMAND, CONN_RETAIN_TRANS
 
Method Summary
 void addLifecycleListener(Object listener, Class... classes)
          Register a listener for lifecycle-related events on the specified classes.
 OpenJPAEntityManager createEntityManager()
           
 OpenJPAEntityManager createEntityManager(Map props)
          Return an entity manager with the provided additional configuration settings.
 OpenJPAConfiguration getConfiguration()
          Return the configuration for this factory.
 Properties getProperties()
          Return properties describing this runtime.
 QueryResultCache getQueryResultCache()
          Access query result cache.
 StoreCache getStoreCache()
          Access the level 2 store cache.
 StoreCache getStoreCache(String name)
          Access a named level 2 store cache.
 Object getUserObject(Object key)
          Get the value for the specified key from the map of user objects.
 Object putUserObject(Object key, Object val)
          Put the specified key-value pair into the map of user objects.
 void removeLifecycleListener(Object listener)
          Remove a listener for lifecycle-related events.
 
Methods inherited from interface javax.persistence.EntityManagerFactory
close, isOpen
 
Methods inherited from interface org.apache.openjpa.lib.util.Closeable
close
 

Method Detail

getConfiguration

OpenJPAConfiguration getConfiguration()
Return the configuration for this factory.


getProperties

Properties getProperties()
Return properties describing this runtime.


putUserObject

Object putUserObject(Object key,
                     Object val)
Put the specified key-value pair into the map of user objects.


getUserObject

Object getUserObject(Object key)
Get the value for the specified key from the map of user objects.


getStoreCache

StoreCache getStoreCache()
Access the level 2 store cache. This cache acts as a proxy to all named caches.


getStoreCache

StoreCache getStoreCache(String name)
Access a named level 2 store cache.


getQueryResultCache

QueryResultCache getQueryResultCache()
Access query result cache.


createEntityManager

OpenJPAEntityManager createEntityManager()
Specified by:
createEntityManager in interface EntityManagerFactory

createEntityManager

OpenJPAEntityManager createEntityManager(Map props)
Return an entity manager with the provided additional configuration settings. OpenJPA recognizes the following configuration settings in this method:

Specified by:
createEntityManager in interface EntityManagerFactory

addLifecycleListener

void addLifecycleListener(Object listener,
                          Class... classes)
Register a listener for lifecycle-related events on the specified classes. If the classes are null, all events will be propagated to the listener. The listener will be passed on to all new entity managers. See the org.apache.openjpa.event package for listener types.

Since:
0.3.3

removeLifecycleListener

void removeLifecycleListener(Object listener)
Remove a listener for lifecycle-related events.

Since:
0.3.3


Copyright © 2006 Apache Software Foundation. All Rights Reserved.