Package org.apache.openjpa.meta
Class AbstractMetaDataFactory
- java.lang.Object
 - 
- org.apache.openjpa.meta.AbstractMetaDataFactory
 
 
- 
- All Implemented Interfaces:
 MetaDataFactory,MetaDataModes
- Direct Known Subclasses:
 AbstractCFMetaDataFactory
public abstract class AbstractMetaDataFactory extends Object implements MetaDataFactory
AbstractMetaDataFactorythat provides default implementations of many methods.- Author:
 - Abe White
 
 
- 
- 
Field Summary
Fields Modifier and Type Field Description protected Filedirprotected Loglogprotected MetaDataRepositoryreposprotected intstoreprotected booleanstrictprotected Settypes- 
Fields inherited from interface org.apache.openjpa.meta.MetaDataFactory
STORE_DEFAULT, STORE_PER_CLASS, STORE_VERBOSE 
- 
Fields 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
Constructors Constructor Description AbstractMetaDataFactory() 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddClassExtensionKeys(Collection exts)Add any extension keys used by this instance to the given set.voidaddFieldExtensionKeys(Collection exts)Add 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).SetgetPersistentTypeNames(boolean devpath, ClassLoader envLoader)Return all persistent class names, using the metadata locations supplied in configuration, optionally scanning the classpath.ClassgetQueryScope(String queryName, ClassLoader loader)Return the type defining the given query name, if any.ClassgetResultSetMappingScope(String resultSetMappingName, ClassLoader loader)Return the type defining the given result set mapping name, if any.ClassArgParsernewClassArgParser()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.voidsetTypes(String types)Set of semicolon-separated persistent type names supplied by user via auto-configuration.voidsetTypes(Set types)Set of persistent type names supplied by user.booleanstore(ClassMetaData[] metas, QueryMetaData[] queries, SequenceMetaData[] seqs, int mode, Map<File,String> output)Store the given metadata.- 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 
- 
Methods inherited from interface org.apache.openjpa.meta.MetaDataFactory
getDefaults, getManagedClass, getManagedClassName, getMetaModelClassName, isMetaClass, load, loadXMLMetaData 
 - 
 
 - 
 
- 
- 
Field Detail
- 
repos
protected MetaDataRepository repos
 
- 
log
protected transient Log log
 
- 
dir
protected File dir
 
- 
store
protected int store
 
- 
strict
protected boolean strict
 
- 
types
protected Set types
 
 - 
 
- 
Method Detail
- 
setTypes
public void setTypes(Set types)
Set of persistent type names supplied by user. 
- 
setTypes
public void setTypes(String types)
Set of semicolon-separated persistent type names supplied by user via auto-configuration. 
- 
setRepository
public void setRepository(MetaDataRepository repos)
Description copied from interface:MetaDataFactorySet the repository to load metadata into. This method will be called before use.- Specified by:
 setRepositoryin interfaceMetaDataFactory
 
- 
setStoreDirectory
public void setStoreDirectory(File dir)
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
 
- 
store
public boolean store(ClassMetaData[] metas, QueryMetaData[] queries, SequenceMetaData[] seqs, int mode, Map<File,String> 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
public boolean drop(Class[] cls, int mode, ClassLoader envLoader)
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
 
 
- 
getPersistentTypeNames
public Set getPersistentTypeNames(boolean devpath, ClassLoader envLoader)
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
public Class getQueryScope(String queryName, ClassLoader loader)
Description copied from interface:MetaDataFactoryReturn the type defining the given query name, if any.- Specified by:
 getQueryScopein interfaceMetaDataFactory
 
- 
getResultSetMappingScope
public Class getResultSetMappingScope(String resultSetMappingName, ClassLoader loader)
Description copied from interface:MetaDataFactoryReturn the type defining the given result set mapping name, if any.- Specified by:
 getResultSetMappingScopein interfaceMetaDataFactory
 
- 
newClassArgParser
public ClassArgParser newClassArgParser()
Description copied from interface:MetaDataFactoryReturn a properly-configured class arg parser for our expected metadata format.- Specified by:
 newClassArgParserin interfaceMetaDataFactory
 
- 
clear
public void clear()
Description copied from interface:MetaDataFactoryClear any internal caches.- Specified by:
 clearin interfaceMetaDataFactory
 
- 
addClassExtensionKeys
public void addClassExtensionKeys(Collection exts)
Description copied from interface:MetaDataFactoryAdd any extension keys used by this instance to the given set.- Specified by:
 addClassExtensionKeysin interfaceMetaDataFactory
 
- 
addFieldExtensionKeys
public void addFieldExtensionKeys(Collection exts)
Description copied from interface:MetaDataFactoryAdd any extension keys used by this instance to the given set.- Specified by:
 addFieldExtensionKeysin interfaceMetaDataFactory
 
 - 
 
 -