Package org.apache.openjpa.jdbc.meta
Class MetaDataPlusMappingFactory
- java.lang.Object
 - 
- org.apache.openjpa.meta.DelegatingMetaDataFactory
 - 
- org.apache.openjpa.jdbc.meta.MetaDataPlusMappingFactory
 
 
 
- 
- All Implemented Interfaces:
 MetaDataFactory,MetaDataModes
public class MetaDataPlusMappingFactory extends DelegatingMetaDataFactory
Combines two internalMetaDataFactoryinstances -- one for metadata, one for mappings -- into a singleMetaDataFactoryfacade.- Author:
 - Abe White
 
 
- 
- 
Field Summary
- 
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 MetaDataPlusMappingFactory(MetaDataFactory meta, MetaDataFactory map)Constructor; supply delegates.MetaDataPlusMappingFactory(MetaDataFactory meta, MetaDataFactory map, OpenJPAConfiguration conf)Constructor, supply delegates and Configuration. 
- 
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).MetaDataFactorygetInnermostMappingDelegate()Innermost mapping delegate.MetaDataFactorygetMappingDelegate()Mapping factory delegate.SetgetPersistentTypeNames(boolean classpath, ClassLoader envLoader)Return all persistent class names, using the metadata locations supplied in configuration, optionally scanning the classpath.voidload(Class cls, int mode, ClassLoader envLoader)Load metadata for the given class in the given mode(s).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.- 
Methods inherited from class org.apache.openjpa.meta.DelegatingMetaDataFactory
getDefaults, getDelegate, getInnermostDelegate, getManagedClass, getManagedClassName, getMetaModelClassName, getQueryScope, getResultSetMappingScope, isMetaClass, loadXMLMetaData, newClassArgParser 
 - 
 
 - 
 
- 
- 
Constructor Detail
- 
MetaDataPlusMappingFactory
public MetaDataPlusMappingFactory(MetaDataFactory meta, MetaDataFactory map)
Constructor; supply delegates. 
- 
MetaDataPlusMappingFactory
public MetaDataPlusMappingFactory(MetaDataFactory meta, MetaDataFactory map, OpenJPAConfiguration conf)
Constructor, supply delegates and Configuration.- Parameters:
 meta- MetaFactory delegate, should not be null.map- MappingFactory delegate, should not be null.conf- Configuration in use. Used to determine whether delegates should use strict mode.
 
 - 
 
- 
Method Detail
- 
getMappingDelegate
public MetaDataFactory getMappingDelegate()
Mapping factory delegate. 
- 
getInnermostMappingDelegate
public MetaDataFactory getInnermostMappingDelegate()
Innermost mapping delegate. 
- 
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- Overrides:
 setRepositoryin classDelegatingMetaDataFactory
 
- 
setStoreDirectory
public void setStoreDirectory(File dir)
Description copied from interface:MetaDataFactoryBase directory for storing metadata. May not be called.- Specified by:
 setStoreDirectoryin interfaceMetaDataFactory- Overrides:
 setStoreDirectoryin classDelegatingMetaDataFactory
 
- 
setStoreMode
public void setStoreMode(int store)
Description copied from interface:MetaDataFactoryStorage mode. May not be called.- Specified by:
 setStoreModein interfaceMetaDataFactory- Overrides:
 setStoreModein classDelegatingMetaDataFactory
 
- 
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- Overrides:
 setStrictin classDelegatingMetaDataFactory
 
- 
load
public void load(Class cls, int mode, ClassLoader envLoader)
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 interfaceMetaDataFactory- Overrides:
 loadin classDelegatingMetaDataFactorymode- 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 interfaceMetaDataFactory- Overrides:
 storein classDelegatingMetaDataFactorymode- 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- Overrides:
 dropin classDelegatingMetaDataFactory- Returns:
 - false if any metadata could not be dropped
 
 
- 
getPersistentTypeNames
public Set getPersistentTypeNames(boolean classpath, 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.- Specified by:
 getPersistentTypeNamesin interfaceMetaDataFactory- Overrides:
 getPersistentTypeNamesin classDelegatingMetaDataFactory- See Also:
 MetaDataRepository.getPersistentTypeNames(boolean, java.lang.ClassLoader),MetaDataRepository.loadPersistentTypes(boolean, java.lang.ClassLoader)
 
- 
clear
public void clear()
Description copied from interface:MetaDataFactoryClear any internal caches.- Specified by:
 clearin interfaceMetaDataFactory- Overrides:
 clearin classDelegatingMetaDataFactory
 
- 
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- Overrides:
 addClassExtensionKeysin classDelegatingMetaDataFactory
 
- 
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- Overrides:
 addFieldExtensionKeysin classDelegatingMetaDataFactory
 
 - 
 
 -