public class PersistenceProductDerivation extends AbstractProductDerivation implements OpenJPAProductDerivation
openjpa.properties system property for
the location of a file to parse. If no system property is defined, the
default resource location of META-INF/openjpa.xml is used.
For defaults, looks for META-INF/persistence.xml.
Within persistence.xml, look for the named persistence unit, or
if no name given, an OpenJPA unit (preferring an unnamed OpenJPA unit to
a named one).| Modifier and Type | Class and Description |
|---|---|
static class |
PersistenceProductDerivation.ConfigurationParser
SAX handler capable of parsing an JPA persistence.xml file.
|
static class |
PersistenceProductDerivation.ConfigurationProviderImpl
Custom configuration provider.
|
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
_providerImplName |
static Specification |
ALIAS_EJB |
static java.lang.String |
PREFIX |
static java.lang.String |
RSRC_DEFAULT |
static java.lang.String |
RSRC_GLOBAL |
static Specification |
SPEC_JPA |
static java.math.BigDecimal |
VERSION_1_0 |
TYPE_PRODUCT_STORE, TYPE_SPEC, TYPE_SPEC_STORE, TYPE_STORETYPE_FEATURE, TYPE_PRODUCT| Constructor and Description |
|---|
PersistenceProductDerivation() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
afterSpecificationSet(Configuration c)
Called after the specification has been set.
|
boolean |
beforeConfigurationLoad(Configuration c)
Provides the instance with the opportunity to mutate
conf before the user configuration is applied. |
boolean |
checkPuNameCollisions(Log logger,
java.lang.String puName)
This method checks to see if the provided
puName was
detected in multiple resources. |
java.util.List<java.lang.String> |
getAnchorsInFile(java.io.File file)
Return a List
file. |
java.util.List |
getAnchorsInResource(java.lang.String resource)
Return a List
resource. |
java.lang.String |
getConfigurationPrefix()
Return the configuration prefix for properties of this product.
|
java.lang.String |
getDefaultResourceLocation()
Return a string identifying the default resource location for this
product derivation, if one exists.
|
java.util.Set<java.lang.String> |
getSupportedQueryHints()
Return set of Query hint keys recognized by this receiver.
|
int |
getType()
Return the type of derivation.
|
ConfigurationProvider |
load(java.io.File file,
java.lang.String anchor)
Load given file, or return null if it is not a file this receiver
understands.
|
ConfigurationProvider |
load(javax.persistence.spi.PersistenceUnitInfo pinfo,
java.util.Map m)
Load configuration from the given persistence unit with the specified
user properties.
|
ConfigurationProvider |
load(java.lang.String rsrc,
java.lang.String anchor,
java.lang.ClassLoader loader)
Load the given given resource into the returned ConfigurationProvider,
or return null if it is not a resource this receiver understands.
|
ConfigurationProvider |
load(java.lang.String rsrc,
java.lang.String name,
java.util.Map m)
Load configuration from the given resource and unit names, which may
be null.
|
ConfigurationProvider |
loadDefaults(java.lang.ClassLoader loader)
Load defaults into the returned ConfigurationProvider, or return null if
no defaults are found.
|
ConfigurationProvider |
loadGlobals(java.lang.ClassLoader loader)
Load globals into the returned ConfigurationProvider, or return null if
no globals are found.
|
void |
putBrokerFactoryAliases(java.util.Map<java.lang.String,java.lang.String> m)
Load default alias options into the given map.
|
void |
validate()
Ensure that this derivation is valid.
|
beforeConfigurationClose, beforeConfigurationConstructclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbeforeConfigurationClose, beforeConfigurationConstructpublic static final Specification SPEC_JPA
public static final Specification ALIAS_EJB
public static final java.lang.String RSRC_GLOBAL
public static final java.lang.String RSRC_DEFAULT
public static final java.math.BigDecimal VERSION_1_0
public static final java.lang.String PREFIX
protected java.lang.String _providerImplName
public void putBrokerFactoryAliases(java.util.Map<java.lang.String,java.lang.String> m)
OpenJPAProductDerivationputBrokerFactoryAliases in interface OpenJPAProductDerivationpublic int getType()
ProductDerivationgetType in interface ProductDerivationpublic java.lang.String getConfigurationPrefix()
ProductDerivationgetConfigurationPrefix in interface ProductDerivationgetConfigurationPrefix in class AbstractProductDerivationpublic java.util.Set<java.lang.String> getSupportedQueryHints()
ProductDerivationgetSupportedQueryHints in interface ProductDerivationgetSupportedQueryHints in class AbstractProductDerivationpublic void validate()
throws java.lang.Exception
ProductDerivationvalidate in interface ProductDerivationvalidate in class AbstractProductDerivationjava.lang.Exceptionpublic boolean beforeConfigurationLoad(Configuration c)
ProductDerivationconf before the user configuration is applied.beforeConfigurationLoad in interface ProductDerivationbeforeConfigurationLoad in class AbstractProductDerivationpublic boolean afterSpecificationSet(Configuration c)
ProductDerivationafterSpecificationSet in interface ProductDerivationafterSpecificationSet in class AbstractProductDerivationpublic ConfigurationProvider load(javax.persistence.spi.PersistenceUnitInfo pinfo, java.util.Map m) throws java.io.IOException
java.io.IOExceptionpublic ConfigurationProvider load(java.lang.String rsrc, java.lang.String name, java.util.Map m) throws java.io.IOException
java.io.IOExceptionpublic ConfigurationProvider load(java.lang.String rsrc, java.lang.String anchor, java.lang.ClassLoader loader) throws java.io.IOException
ProductDerivationload in interface ProductDerivationload in class AbstractProductDerivationanchor - optional named anchor within a multiple-configuration
resourcejava.io.IOExceptionpublic ConfigurationProvider load(java.io.File file, java.lang.String anchor) throws java.io.IOException
ProductDerivationload in interface ProductDerivationload in class AbstractProductDerivationanchor - optional named anchor within a multiple-configuration filejava.io.IOExceptionpublic java.lang.String getDefaultResourceLocation()
ProductDerivationnull.getDefaultResourceLocation in interface ProductDerivationgetDefaultResourceLocation in class AbstractProductDerivationpublic java.util.List<java.lang.String> getAnchorsInFile(java.io.File file)
throws java.io.IOException
ProductDerivationfile.
The returned names are not fully-qualified, so must be used in
conjunction with file in calls
to ProductDerivation.load(java.io.File, String).
Returns null or an empty list if no anchors could be found.getAnchorsInFile in interface ProductDerivationgetAnchorsInFile in class AbstractProductDerivationjava.io.IOExceptionpublic java.util.List getAnchorsInResource(java.lang.String resource)
throws java.lang.Exception
ProductDerivationresource. The returned names are not
fully-qualified, so must be used in conjunction with
resource in calls to ProductDerivation.load(java.io.File, String).
Returns null or an empty list if no anchors could be found.getAnchorsInResource in interface ProductDerivationgetAnchorsInResource in class AbstractProductDerivationjava.lang.Exceptionpublic ConfigurationProvider loadGlobals(java.lang.ClassLoader loader) throws java.io.IOException
ProductDerivationloadGlobals in interface ProductDerivationloadGlobals in class AbstractProductDerivationjava.io.IOExceptionpublic ConfigurationProvider loadDefaults(java.lang.ClassLoader loader) throws java.io.IOException
ProductDerivationloadDefaults in interface ProductDerivationloadDefaults in class AbstractProductDerivationjava.io.IOExceptionpublic boolean checkPuNameCollisions(Log logger, java.lang.String puName)
puName was
detected in multiple resources. If a collision is detected, a warning
will be logged and this method will return true.
Copyright © 2006-2013 Apache Software Foundation. All Rights Reserved.