public class PersistenceMetaDataFactory extends AbstractCFMetaDataFactory implements Configurable, GenericConfigurable
MetaDataFactory
for JPA metadata.AbstractCFMetaDataFactory.Parser, AbstractCFMetaDataFactory.Serializer
Modifier and Type | Field and Description |
---|---|
protected Stack<XMLPersistenceMetaDataParser> |
_stack |
cpath, files, JAR_FILE_URLS, MAPPING_FILE_NAMES, PERSISTENCE_UNIT_ROOT_URL, rsrcs, urls
dir, log, repos, store, strict, types
STORE_DEFAULT, STORE_PER_CLASS, STORE_VERBOSE
MODE_ALL, MODE_ANN_MAPPING, MODE_MAPPING, MODE_MAPPING_INIT, MODE_META, MODE_NONE, MODE_QUERY
Constructor and Description |
---|
PersistenceMetaDataFactory() |
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clear any internal caches.
|
protected File |
defaultSourceFile(ClassMetaData meta)
Return the default file for the given metadata.
|
protected File |
defaultSourceFile(QueryMetaData query,
Map clsNames)
Return a default file for the given query.
|
protected File |
defaultSourceFile(SequenceMetaData seq,
Map clsNames)
Return a default file for the given sequence.
|
void |
endConfiguration()
Invoked upon completion of bean property configuration for this object.
|
AnnotationPersistenceMetaDataParser |
getAnnotationParser()
Return metadata parser, creating it if it does not already exist.
|
MetaDataDefaults |
getDefaults()
Return the metadata defaults for this factory.
|
boolean |
getFieldOverride()
Whether to use field-level override or class-level override.
|
Class<?> |
getManagedClass(Class<?> c)
Gets the managed class corresponding to the given meta-class.
|
String |
getManagedClassName(String mmClassName)
Gets the name of the managed class for the given fully-qualified
meta-model class name.
|
String |
getMetaModelClassName(String managedClassName)
Gets the name of the meta-model class for the given fully-qualified
managed class name.
|
Class<?> |
getQueryScope(String queryName,
ClassLoader loader)
Return the type defining the given query name, if any.
|
Class<?> |
getResultSetMappingScope(String rsMappingName,
ClassLoader loader)
Return the type defining the given result set mapping name, if any.
|
AnnotationPersistenceXMLMetaDataParser |
getXMLAnnotationParser()
Return JAXB XML annotation parser,
creating it if it does not already exist.
|
XMLPersistenceMetaDataParser |
getXMLParser()
Return XML metadata parser, creating it if it does not already exist or
if the existing parser is parsing.
|
boolean |
isMetaClass(Class<?> c)
Affirms if the given class is a meta-class.
|
void |
load(Class<?> cls,
int mode,
ClassLoader envLoader)
Load metadata for the given class in the given mode(s).
|
void |
loadXMLMetaData(Class<?> cls)
Load XMLClassMetadata for the given class.
|
protected void |
mapPersistentTypeNames(Object rsrc,
String[] names)
Implement this method to map metadata resources to the persistent
types contained within them.
|
protected AnnotationPersistenceMetaDataParser |
newAnnotationParser()
Create a new metadata parser.
|
protected AnnotationPersistenceMetaDataSerializer |
newAnnotationSerializer()
Create a new annotation serializer.
|
ClassArgParser |
newClassArgParser()
Return a properly-configured class arg parser for our expected
metadata format.
|
protected MetaDataFilter |
newMetaDataFilter()
Return a metadata filter that identifies metadata resources when
performing jar and classpath scans.
|
protected AbstractCFMetaDataFactory.Parser |
newParser(boolean loading)
Create a new metadata parser.
|
protected AbstractCFMetaDataFactory.Serializer |
newSerializer()
Create a new metadata serializer.
|
protected AnnotationPersistenceXMLMetaDataParser |
newXMLAnnotationParser()
Create a new JAXB XML annotation parser.
|
protected XMLPersistenceMetaDataParser |
newXMLParser(boolean loading)
Create a new metadata parser.
|
protected XMLPersistenceMetaDataSerializer |
newXMLSerializer()
Create a new serializer
|
protected void |
parse(MetaDataParser parser,
Class[] cls)
Parse all given classses.
|
void |
resetXMLParser() |
void |
setAnnotationParser(AnnotationPersistenceMetaDataParser parser)
Set the metadata parser.
|
void |
setConfiguration(Configuration conf)
Invoked prior to setting bean properties.
|
void |
setFieldOverride(boolean field)
Whether to use field-level override or class-level override.
|
void |
setInto(Options opts)
Perform any generic configuration based on the data in
opts . |
void |
setXMLAnnotationParser(AnnotationPersistenceXMLMetaDataParser parser)
Set the JAXB XML annotation parser.
|
void |
setXMLParser(XMLPersistenceMetaDataParser parser)
Set the metadata parser.
|
void |
startConfiguration()
Invoked before bean property configuration is begun on this object.
|
backupAndDelete, clearMapping, decode, drop, getDefiningMetaData, getPersistentTypeNames, getSourceFile, getSourceFile, isMappingOnlyFactory, isParseTopDown, parse, parsePersistentTypeNames, serialize, setClasspathScan, setClasspathScan, setFiles, setFiles, setResources, setResources, setSourceFile, setSourceFile, setURLs, setURLs, store
addClassExtensionKeys, addFieldExtensionKeys, setRepository, setStoreDirectory, setStoreMode, setStrict, setTypes, setTypes
protected Stack<XMLPersistenceMetaDataParser> _stack
public void setFieldOverride(boolean field)
public boolean getFieldOverride()
public AnnotationPersistenceMetaDataParser getAnnotationParser()
public void setAnnotationParser(AnnotationPersistenceMetaDataParser parser)
protected AnnotationPersistenceMetaDataParser newAnnotationParser()
protected AnnotationPersistenceMetaDataSerializer newAnnotationSerializer()
newAnnotationSerializer
in class AbstractCFMetaDataFactory
public XMLPersistenceMetaDataParser getXMLParser()
public void resetXMLParser()
public void setXMLParser(XMLPersistenceMetaDataParser parser)
protected XMLPersistenceMetaDataParser newXMLParser(boolean loading)
protected XMLPersistenceMetaDataSerializer newXMLSerializer()
public void load(Class<?> cls, int mode, ClassLoader envLoader)
MetaDataFactory
MetaDataModes.MODE_QUERY
, the class may be null. Loaded
metadata should be added directly to the repository. It should have
its source mode set appropriately via
ClassMetaData.setSourceMode(int)
.load
in interface MetaDataFactory
mode
- the mode to load metadata in: if mapping information is
stored together with metadata, then you can load mapping
data even if this mode only includes
MODE_META
, so long as
the strict
property hasn't been setprotected void mapPersistentTypeNames(Object rsrc, String[] names)
AbstractCFMetaDataFactory
AbstractCFMetaDataFactory.getPersistentTypeNames(boolean, java.lang.ClassLoader)
is invoked.mapPersistentTypeNames
in class AbstractCFMetaDataFactory
public Class<?> getQueryScope(String queryName, ClassLoader loader)
MetaDataFactory
getQueryScope
in interface MetaDataFactory
getQueryScope
in class AbstractMetaDataFactory
public Class<?> getResultSetMappingScope(String rsMappingName, ClassLoader loader)
MetaDataFactory
getResultSetMappingScope
in interface MetaDataFactory
getResultSetMappingScope
in class AbstractMetaDataFactory
protected MetaDataFilter newMetaDataFilter()
AbstractCFMetaDataFactory
newMetaDataFilter
in class AbstractCFMetaDataFactory
public MetaDataDefaults getDefaults()
MetaDataFactory
getDefaults
in interface MetaDataFactory
public ClassArgParser newClassArgParser()
MetaDataFactory
newClassArgParser
in interface MetaDataFactory
newClassArgParser
in class AbstractMetaDataFactory
public void clear()
MetaDataFactory
clear
in interface MetaDataFactory
clear
in class AbstractCFMetaDataFactory
protected AbstractCFMetaDataFactory.Parser newParser(boolean loading)
AbstractCFMetaDataFactory
newParser
in class AbstractCFMetaDataFactory
loading
- if true, this will be the cached parser used for
loading metadataprotected AbstractCFMetaDataFactory.Serializer newSerializer()
AbstractCFMetaDataFactory
newSerializer
in class AbstractCFMetaDataFactory
protected void parse(MetaDataParser parser, Class[] cls)
AbstractCFMetaDataFactory
parse
in class AbstractCFMetaDataFactory
protected File defaultSourceFile(ClassMetaData meta)
AbstractCFMetaDataFactory
defaultSourceFile
in class AbstractCFMetaDataFactory
protected File defaultSourceFile(QueryMetaData query, Map clsNames)
AbstractCFMetaDataFactory
defaultSourceFile
in class AbstractCFMetaDataFactory
protected File defaultSourceFile(SequenceMetaData seq, Map clsNames)
AbstractCFMetaDataFactory
defaultSourceFile
in class AbstractCFMetaDataFactory
public void setConfiguration(Configuration conf)
Configurable
setConfiguration
in interface Configurable
public void startConfiguration()
Configurable
startConfiguration
in interface Configurable
public void endConfiguration()
Configurable
endConfiguration
in interface Configurable
public void setInto(Options opts)
GenericConfigurable
opts
. This method should remove any values in
opts
that have been successfully processed; if any
values remain in opts
after this method is executed,
an exception will be thrown identifying those key-value pairs as invalid.setInto
in interface GenericConfigurable
public AnnotationPersistenceXMLMetaDataParser getXMLAnnotationParser()
public void setXMLAnnotationParser(AnnotationPersistenceXMLMetaDataParser parser)
protected AnnotationPersistenceXMLMetaDataParser newXMLAnnotationParser()
public void loadXMLMetaData(Class<?> cls)
MetaDataFactory
loadXMLMetaData
in interface MetaDataFactory
public String getManagedClassName(String mmClassName)
MetaDataFactory
getManagedClassName
in interface MetaDataFactory
public String getMetaModelClassName(String managedClassName)
MetaDataFactory
getMetaModelClassName
in interface MetaDataFactory
public boolean isMetaClass(Class<?> c)
MetaDataFactory
isMetaClass
in interface MetaDataFactory
public Class<?> getManagedClass(Class<?> c)
MetaDataFactory
getManagedClass
in interface MetaDataFactory
Copyright © 2006–2018 Apache Software Foundation. All rights reserved.