org.apache.openjpa.persistence
Class PersistenceProviderImpl

java.lang.Object
  extended by org.apache.openjpa.persistence.PersistenceProviderImpl
All Implemented Interfaces:
PersistenceProvider, ProviderUtil

public class PersistenceProviderImpl
extends Object
implements PersistenceProvider, ProviderUtil

Bootstrapping class that allows the creation of a stand-alone EntityManager.

See Also:
Persistence.createEntityManagerFactory(String,Map)

Field Summary
(package private) static String CLASS_TRANSFORMER_OPTIONS
           
 
Constructor Summary
PersistenceProviderImpl()
           
 
Method Summary
 OpenJPAEntityManagerFactory createContainerEntityManagerFactory(PersistenceUnitInfo pui, Map m)
           
 OpenJPAEntityManagerFactory createEntityManagerFactory(String name, Map m)
           
 OpenJPAEntityManagerFactory createEntityManagerFactory(String name, String resource, Map m)
          Loads the entity manager specified by name, applying the properties in m as overrides to the properties defined in the XML configuration file for name.
protected  String getDefaultBrokerAlias()
           
 ProviderUtil getProviderUtil()
           
 LoadState isLoaded(Object obj)
          Determines whether the specified object is loaded.
 LoadState isLoadedWithoutReference(Object obj, String attr)
          Determines whether the attribute on the specified object is loaded.
 LoadState isLoadedWithReference(Object obj, String attr)
          Determines whether the attribute on the specified object is loaded.
protected  OpenJPAConfiguration newConfigurationImpl()
           
 void setPersistenceEnvironmentInfo(OpenJPAConfiguration conf, PersistenceUnitInfo pui)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_TRANSFORMER_OPTIONS

static final String CLASS_TRANSFORMER_OPTIONS
See Also:
Constant Field Values
Constructor Detail

PersistenceProviderImpl

public PersistenceProviderImpl()
Method Detail

createEntityManagerFactory

public OpenJPAEntityManagerFactory createEntityManagerFactory(String name,
                                                              String resource,
                                                              Map m)
Loads the entity manager specified by name, applying the properties in m as overrides to the properties defined in the XML configuration file for name. If name is null, this method loads the XML in the resource identified by resource, and uses the first resource found when doing this lookup, regardless of the name specified in the XML resource or the name of the jar that the resource is contained in. This does no pooling of EntityManagersFactories.

Returns:
EntityManagerFactory or null

createEntityManagerFactory

public OpenJPAEntityManagerFactory createEntityManagerFactory(String name,
                                                              Map m)
Specified by:
createEntityManagerFactory in interface PersistenceProvider

createContainerEntityManagerFactory

public OpenJPAEntityManagerFactory createContainerEntityManagerFactory(PersistenceUnitInfo pui,
                                                                       Map m)
Specified by:
createContainerEntityManagerFactory in interface PersistenceProvider

setPersistenceEnvironmentInfo

public void setPersistenceEnvironmentInfo(OpenJPAConfiguration conf,
                                          PersistenceUnitInfo pui)

getProviderUtil

public ProviderUtil getProviderUtil()
Specified by:
getProviderUtil in interface PersistenceProvider

getDefaultBrokerAlias

protected String getDefaultBrokerAlias()

newConfigurationImpl

protected OpenJPAConfiguration newConfigurationImpl()

isLoaded

public LoadState isLoaded(Object obj)
Determines whether the specified object is loaded.

Specified by:
isLoaded in interface ProviderUtil
Returns:
LoadState.LOADED - if all implicit or explicit EAGER fetch attributes are loaded LoadState.NOT_LOADED - if any implicit or explicit EAGER fetch attribute is not loaded LoadState.UNKNOWN - if the entity is not managed by this provider.

isLoadedWithReference

public LoadState isLoadedWithReference(Object obj,
                                       String attr)
Determines whether the attribute on the specified object is loaded. This method may access the value of the attribute to determine load state (but currently does not).

Specified by:
isLoadedWithReference in interface ProviderUtil
Returns:
LoadState.LOADED - if the attribute is loaded. LoadState.NOT_LOADED - if the attribute is not loaded or any EAGER fetch attributes of the entity are not loaded. LoadState.UNKNOWN - if the entity is not managed by this provider or if it does not contain the persistent attribute.

isLoadedWithoutReference

public LoadState isLoadedWithoutReference(Object obj,
                                          String attr)
Determines whether the attribute on the specified object is loaded. This method does not access the value of the attribute to determine load state.

Specified by:
isLoadedWithoutReference in interface ProviderUtil
Returns:
LoadState.LOADED - if the attribute is loaded. LoadState.NOT_LOADED - if the attribute is not loaded or any EAGER fetch attributes of the entity are not loaded. LoadState.UNKNOWN - if the entity is not managed by this provider or if it does not contain the persistent attribute.


Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.