Package org.apache.openjpa.meta
Class DelegatingMetaDataFactory
java.lang.Object
org.apache.openjpa.meta.DelegatingMetaDataFactory
- All Implemented Interfaces:
MetaDataFactory,MetaDataModes
- Direct Known Subclasses:
MetaDataPlusMappingFactory
Base class for factory instances that use a delegate.
- Author:
- Abe White
-
Field Summary
Fields inherited from interface org.apache.openjpa.meta.MetaDataFactory
STORE_DEFAULT, STORE_PER_CLASS, STORE_VERBOSEFields inherited from interface org.apache.openjpa.meta.MetaDataModes
MODE_ALL, MODE_ANN_MAPPING, MODE_MAPPING, MODE_MAPPING_INIT, MODE_META, MODE_NONE, MODE_QUERY -
Constructor Summary
ConstructorsConstructorDescriptionDelegatingMetaDataFactory(MetaDataFactory delegate) Constructor; supply delegate. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd any extension keys used by this instance to the given set.voidAdd any extension keys used by this instance to the given set.voidclear()Clear any internal caches.booleandrop(Class[] cls, int mode, ClassLoader envLoader) Drop the metadata for the given classes in the given mode(s).Return the metadata defaults for this factory.Factory delegate.Innermost delegate.Class<?>getManagedClass(Class<?> c) Gets the managed class corresponding to the given meta-class.getManagedClassName(String metamodelClassName) Gets the name of the managed class for the given fully-qualified meta-model class name.getMetaModelClassName(String managedClassName) Gets the name of the meta-model class for the given fully-qualified managed class name.getPersistentTypeNames(boolean classpath, ClassLoader envLoader) Return all persistent class names, using the metadata locations supplied in configuration, optionally scanning the classpath.getQueryScope(String queryName, ClassLoader loader) Return the type defining the given query name, if any.getResultSetMappingScope(String resultSetMappingName, ClassLoader loader) Return the type defining the given result set mapping name, if any.booleanisMetaClass(Class<?> c) Affirms if the given class is a meta-class.voidload(Class cls, int mode, ClassLoader envLoader) Load metadata for the given class in the given mode(s).voidloadXMLMetaData(Class<?> cls) Load XMLClassMetadata for the given class.Return a properly-configured class arg parser for our expected metadata format.voidsetRepository(MetaDataRepository repos) Set the repository to load metadata into.voidsetStoreDirectory(File dir) Base directory for storing metadata.voidsetStoreMode(int store) Storage mode.voidsetStrict(boolean strict) If true, I/O's must exactly obey the mode directives given, and may not load additional information.booleanstore(ClassMetaData[] metas, QueryMetaData[] queries, SequenceMetaData[] seqs, int mode, Map output) Store the given metadata.
-
Constructor Details
-
DelegatingMetaDataFactory
Constructor; supply delegate.
-
-
Method Details
-
getDelegate
Factory delegate. -
getInnermostDelegate
Innermost delegate. -
setRepository
Description copied from interface:MetaDataFactorySet the repository to load metadata into. This method will be called before use.- Specified by:
setRepositoryin interfaceMetaDataFactory
-
setStoreDirectory
Description copied from interface:MetaDataFactoryBase directory for storing metadata. May not be called.- Specified by:
setStoreDirectoryin interfaceMetaDataFactory
-
setStoreMode
public void setStoreMode(int store) Description copied from interface:MetaDataFactoryStorage mode. May not be called.- Specified by:
setStoreModein interfaceMetaDataFactory
-
setStrict
public void setStrict(boolean strict) Description copied from interface:MetaDataFactoryIf true, I/O's must exactly obey the mode directives given, and may not load additional information.- Specified by:
setStrictin interfaceMetaDataFactory
-
load
Description copied from interface:MetaDataFactoryLoad metadata for the given class in the given mode(s). If loading inMetaDataModes.MODE_QUERY, the class may be null. Loaded metadata should be added directly to the repository. It should have its source mode set appropriately viaClassMetaData.setSourceMode(int).- Specified by:
loadin interfaceMetaDataFactorymode- 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 includesMODE_META, so long as thestrictproperty hasn't been set
-
store
public boolean store(ClassMetaData[] metas, QueryMetaData[] queries, SequenceMetaData[] seqs, int mode, Map output) Description copied from interface:MetaDataFactoryStore the given metadata.- Specified by:
storein interfaceMetaDataFactorymode- hint about what aspects of the metadata have changedoutput- if non-null, rather than storing metadata directly, add entries mapping each output destination such as aFileto the planned output for that destination in string form- Returns:
- false if this factory is unable to store metadata
-
drop
Description copied from interface:MetaDataFactoryDrop the metadata for the given classes in the given mode(s).- Specified by:
dropin interfaceMetaDataFactory- Returns:
- false if any metadata could not be dropped
-
getDefaults
Description copied from interface:MetaDataFactoryReturn the metadata defaults for this factory.- Specified by:
getDefaultsin interfaceMetaDataFactory
-
newClassArgParser
Description copied from interface:MetaDataFactoryReturn a properly-configured class arg parser for our expected metadata format.- Specified by:
newClassArgParserin interfaceMetaDataFactory
-
getPersistentTypeNames
Description copied from interface:MetaDataFactoryReturn all persistent class names, using the metadata locations supplied in configuration, optionally scanning the classpath. Return null if no types are supplied and this factory is unable to scan the classpath. This method should not be used directly by outside code; useMetaDataRepository.getPersistentTypeNames(boolean, java.lang.ClassLoader)instead. -
getQueryScope
Description copied from interface:MetaDataFactoryReturn the type defining the given query name, if any.- Specified by:
getQueryScopein interfaceMetaDataFactory
-
getResultSetMappingScope
Description copied from interface:MetaDataFactoryReturn the type defining the given result set mapping name, if any.- Specified by:
getResultSetMappingScopein interfaceMetaDataFactory
-
clear
public void clear()Description copied from interface:MetaDataFactoryClear any internal caches.- Specified by:
clearin interfaceMetaDataFactory
-
addClassExtensionKeys
Description copied from interface:MetaDataFactoryAdd any extension keys used by this instance to the given set.- Specified by:
addClassExtensionKeysin interfaceMetaDataFactory
-
addFieldExtensionKeys
Description copied from interface:MetaDataFactoryAdd any extension keys used by this instance to the given set.- Specified by:
addFieldExtensionKeysin interfaceMetaDataFactory
-
loadXMLMetaData
Description copied from interface:MetaDataFactoryLoad XMLClassMetadata for the given class. Loaded metadata should be added directly to the repository.- Specified by:
loadXMLMetaDatain interfaceMetaDataFactory
-
getMetaModelClassName
Description copied from interface:MetaDataFactoryGets the name of the meta-model class for the given fully-qualified managed class name.- Specified by:
getMetaModelClassNamein interfaceMetaDataFactory
-
getManagedClassName
Description copied from interface:MetaDataFactoryGets the name of the managed class for the given fully-qualified meta-model class name.- Specified by:
getManagedClassNamein interfaceMetaDataFactory
-
isMetaClass
Description copied from interface:MetaDataFactoryAffirms if the given class is a meta-class.- Specified by:
isMetaClassin interfaceMetaDataFactory
-
getManagedClass
Description copied from interface:MetaDataFactoryGets the managed class corresponding to the given meta-class.- Specified by:
getManagedClassin interfaceMetaDataFactory- Returns:
- null if the given input is not a meta-class.
-