Package org.apache.openjpa.meta
Class NoneMetaDataFactory
- java.lang.Object
- 
- org.apache.openjpa.meta.NoneMetaDataFactory
 
- 
- All Implemented Interfaces:
- CallbackModes,- MetaDataDefaults,- MetaDataFactory,- MetaDataModes
 
 public class NoneMetaDataFactory extends java.lang.Object implements MetaDataFactory, MetaDataDefaults No-op metadata I/O to prevent attempts to load other classes.- Author:
- Abe White
 
- 
- 
Field Summary- 
Fields inherited from interface org.apache.openjpa.event.CallbackModesCALLBACK_FAIL_FAST, CALLBACK_IGNORE, CALLBACK_LOG, CALLBACK_RETHROW, CALLBACK_ROLLBACK
 - 
Fields inherited from interface org.apache.openjpa.meta.MetaDataFactorySTORE_DEFAULT, STORE_PER_CLASS, STORE_VERBOSE
 - 
Fields inherited from interface org.apache.openjpa.meta.MetaDataModesMODE_ALL, MODE_ANN_MAPPING, MODE_MAPPING, MODE_MAPPING_INIT, MODE_META, MODE_NONE, MODE_QUERY
 
- 
 - 
Constructor SummaryConstructors Constructor Description NoneMetaDataFactory()
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddClassExtensionKeys(java.util.Collection exts)Add any extension keys used by this instance to the given set.voidaddFieldExtensionKeys(java.util.Collection exts)Add any extension keys used by this instance to the given set.voidclear()Clear any internal caches.booleandrop(java.lang.Class[] cls, int mode, java.lang.ClassLoader envLoader)Drop the metadata for the given classes in the given mode(s).java.lang.reflect.MembergetBackingMember(FieldMetaData fmd)Return the backing member for the given field metadata.intgetCallbackMode()What to do on lifecycle callback exceptions.booleangetCallbacksBeforeListeners(int type)If callbacks are fired before listeners for the given event type.intgetDefaultAccessType()Return the default access type for a base persistent class withClassMetaData.ACCESS_UNKNOWNaccess type.intgetDefaultIdentityType()Return the default identity type for unmapped classes without primary key fields.MetaDataDefaultsgetDefaults()Return the metadata defaults for this factory.java.lang.StringgetDefaultSchema()Returns the default schema.static NoneMetaDataFactorygetInstance()java.lang.Class<?>getManagedClass(java.lang.Class<?> c)Gets the managed class corresponding to the given meta-class.java.lang.StringgetManagedClassName(java.lang.String metamodelClassName)Gets the name of the managed class for the given fully-qualified meta-model class name.java.lang.reflect.MembergetMemberByProperty(ClassMetaData meta, java.lang.String property, int access, boolean scan)Get the field or getter for the given attribute of the given class.java.lang.StringgetMetaModelClassName(java.lang.String managedClassName)Gets the name of the meta-model class for the given fully-qualified managed class name.java.util.SetgetPersistentTypeNames(boolean classpath, java.lang.ClassLoader envLoader)Return all persistent class names, using the metadata locations supplied in configuration, optionally scanning the classpath.java.lang.ClassgetQueryScope(java.lang.String queryName, java.lang.ClassLoader loader)Return the type defining the given query name, if any.java.lang.ClassgetResultSetMappingScope(java.lang.String resultSetMappingName, java.lang.ClassLoader loader)Return the type defining the given result set mapping name, if any.java.lang.Class<? extends java.lang.Exception>getUnimplementedExceptionType()Return a runtime exception class to throw for un-implemented managed interface methods.booleanisAbstractMappingUniDirectional(OpenJPAConfiguration conf)Whether the relationship in MappedSuper class must be uni-directional.booleanisDataStoreObjectIdFieldUnwrapped()Whether the field in the object id class corresponding to a datastore id persistence-capable primary key field is the simple datastore id value of the related instance.booleanisDeclaredInterfacePersistent()Whether declared interfaces of a class are treated as persistent types.java.lang.BooleanisDefaultCascadePersistEnabled()Whether cascade-persist was declared in the persistence unit defaults.booleanisMetaClass(java.lang.Class<?> c)Affirms if the given class is a meta-class.booleanisNonDefaultMappingAllowed(OpenJPAConfiguration conf)Whether non-default mapping is allowed.voidload(java.lang.Class cls, int mode, java.lang.ClassLoader envLoader)Load metadata for the given class in the given mode(s).voidloadXMLMetaData(java.lang.Class<?> cls)Load XMLClassMetadata for the given class.ClassArgParsernewClassArgParser()Return a properly-configured class arg parser for our expected metadata format.voidpopulate(ClassMetaData meta, int access)Populate the given metadata with default settings.voidpopulate(ClassMetaData meta, int access, boolean ignoreTransient)Populate the given metadata with default settings.voidsetDefaultCascadePersistEnabled(java.lang.Boolean bool)voidsetDefaultSchema(java.lang.String schema)Sets the default schema.voidsetIgnoreNonPersistent(boolean ignore)Whether to ignore members which are not persistent by default during metadata population.voidsetRepository(MetaDataRepository repos)Set the repository to load metadata into.voidsetStoreDirectory(java.io.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, java.util.Map output)Store the given metadata.
 
- 
- 
- 
Method Detail- 
getInstancepublic static NoneMetaDataFactory getInstance() 
 - 
setRepositorypublic 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 interface- MetaDataFactory
 
 - 
setStoreDirectorypublic void setStoreDirectory(java.io.File dir) Description copied from interface:MetaDataFactoryBase directory for storing metadata. May not be called.- Specified by:
- setStoreDirectoryin interface- MetaDataFactory
 
 - 
setStoreModepublic void setStoreMode(int store) Description copied from interface:MetaDataFactoryStorage mode. May not be called.- Specified by:
- setStoreModein interface- MetaDataFactory
 
 - 
setStrictpublic 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 interface- MetaDataFactory
 
 - 
loadpublic void load(java.lang.Class cls, int mode, java.lang.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 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- strictproperty hasn't been set
 
 - 
storepublic boolean store(ClassMetaData[] metas, QueryMetaData[] queries, SequenceMetaData[] seqs, int mode, java.util.Map output) Description copied from interface:MetaDataFactoryStore the given metadata.- Specified by:
- storein interface- MetaDataFactory
- mode- hint about what aspects of the metadata have changed
- output- if non-null, rather than storing metadata directly, add entries mapping each output destination such as a- Fileto the planned output for that destination in string form
- Returns:
- false if this factory is unable to store metadata
 
 - 
droppublic boolean drop(java.lang.Class[] cls, int mode, java.lang.ClassLoader envLoader)Description copied from interface:MetaDataFactoryDrop the metadata for the given classes in the given mode(s).- Specified by:
- dropin interface- MetaDataFactory
- Returns:
- false if any metadata could not be dropped
 
 - 
getDefaultspublic MetaDataDefaults getDefaults() Description copied from interface:MetaDataFactoryReturn the metadata defaults for this factory.- Specified by:
- getDefaultsin interface- MetaDataFactory
 
 - 
getPersistentTypeNamespublic java.util.Set getPersistentTypeNames(boolean classpath, java.lang.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.
 - 
getQueryScopepublic java.lang.Class getQueryScope(java.lang.String queryName, java.lang.ClassLoader loader)Description copied from interface:MetaDataFactoryReturn the type defining the given query name, if any.- Specified by:
- getQueryScopein interface- MetaDataFactory
 
 - 
getResultSetMappingScopepublic java.lang.Class getResultSetMappingScope(java.lang.String resultSetMappingName, java.lang.ClassLoader loader)Description copied from interface:MetaDataFactoryReturn the type defining the given result set mapping name, if any.- Specified by:
- getResultSetMappingScopein interface- MetaDataFactory
 
 - 
newClassArgParserpublic ClassArgParser newClassArgParser() Description copied from interface:MetaDataFactoryReturn a properly-configured class arg parser for our expected metadata format.- Specified by:
- newClassArgParserin interface- MetaDataFactory
 
 - 
clearpublic void clear() Description copied from interface:MetaDataFactoryClear any internal caches.- Specified by:
- clearin interface- MetaDataFactory
 
 - 
addClassExtensionKeyspublic void addClassExtensionKeys(java.util.Collection exts) Description copied from interface:MetaDataFactoryAdd any extension keys used by this instance to the given set.- Specified by:
- addClassExtensionKeysin interface- MetaDataFactory
 
 - 
addFieldExtensionKeyspublic void addFieldExtensionKeys(java.util.Collection exts) Description copied from interface:MetaDataFactoryAdd any extension keys used by this instance to the given set.- Specified by:
- addFieldExtensionKeysin interface- MetaDataFactory
 
 - 
getDefaultAccessTypepublic int getDefaultAccessType() Description copied from interface:MetaDataDefaultsReturn the default access type for a base persistent class withClassMetaData.ACCESS_UNKNOWNaccess type.- Specified by:
- getDefaultAccessTypein interface- MetaDataDefaults
 
 - 
getDefaultIdentityTypepublic int getDefaultIdentityType() Description copied from interface:MetaDataDefaultsReturn the default identity type for unmapped classes without primary key fields.- Specified by:
- getDefaultIdentityTypein interface- MetaDataDefaults
 
 - 
getCallbackModepublic int getCallbackMode() Description copied from interface:MetaDataDefaultsWhat to do on lifecycle callback exceptions.- Specified by:
- getCallbackModein interface- MetaDataDefaults
 
 - 
getCallbacksBeforeListenerspublic boolean getCallbacksBeforeListeners(int type) Description copied from interface:MetaDataDefaultsIf callbacks are fired before listeners for the given event type. Defaults to false.- Specified by:
- getCallbacksBeforeListenersin interface- MetaDataDefaults
 
 - 
setIgnoreNonPersistentpublic void setIgnoreNonPersistent(boolean ignore) Description copied from interface:MetaDataDefaultsWhether to ignore members which are not persistent by default during metadata population. Defaults to true.- Specified by:
- setIgnoreNonPersistentin interface- MetaDataDefaults
 
 - 
isDeclaredInterfacePersistentpublic boolean isDeclaredInterfacePersistent() Description copied from interface:MetaDataDefaultsWhether declared interfaces of a class are treated as persistent types. Defaults to true.- Specified by:
- isDeclaredInterfacePersistentin interface- MetaDataDefaults
 
 - 
isDataStoreObjectIdFieldUnwrappedpublic boolean isDataStoreObjectIdFieldUnwrapped() Description copied from interface:MetaDataDefaultsWhether the field in the object id class corresponding to a datastore id persistence-capable primary key field is the simple datastore id value of the related instance. Defaults to false.- Specified by:
- isDataStoreObjectIdFieldUnwrappedin interface- MetaDataDefaults
 
 - 
populatepublic void populate(ClassMetaData meta, int access) Description copied from interface:MetaDataDefaultsPopulate the given metadata with default settings.- Specified by:
- populatein interface- MetaDataDefaults
- access- access type constant from- ClassMetaData
 
 - 
populatepublic void populate(ClassMetaData meta, int access, boolean ignoreTransient) Description copied from interface:MetaDataDefaultsPopulate the given metadata with default settings.- Specified by:
- populatein interface- MetaDataDefaults
- access- access type constant from- ClassMetaData
 
 - 
getBackingMemberpublic java.lang.reflect.Member getBackingMember(FieldMetaData fmd) Description copied from interface:MetaDataDefaultsReturn the backing member for the given field metadata.- Specified by:
- getBackingMemberin interface- MetaDataDefaults
 
 - 
getMemberByPropertypublic java.lang.reflect.Member getMemberByProperty(ClassMetaData meta, java.lang.String property, int access, boolean scan) Description copied from interface:MetaDataDefaultsGet the field or getter for the given attribute of the given class.- Specified by:
- getMemberByPropertyin interface- MetaDataDefaults
- Parameters:
- meta- is the declaring class
- property- name of the logical attribute
- access- whether to look for the field of getter method. If unknown, then field or property is chosen based on the access type used by the given class.
- scan- if true and access is unknown then scans the annotation on the member to determine access.
 
 - 
getUnimplementedExceptionTypepublic java.lang.Class<? extends java.lang.Exception> getUnimplementedExceptionType() Description copied from interface:MetaDataDefaultsReturn a runtime exception class to throw for un-implemented managed interface methods.- Specified by:
- getUnimplementedExceptionTypein interface- MetaDataDefaults
 
 - 
loadXMLMetaDatapublic void loadXMLMetaData(java.lang.Class<?> cls) Description copied from interface:MetaDataFactoryLoad XMLClassMetadata for the given class. Loaded metadata should be added directly to the repository.- Specified by:
- loadXMLMetaDatain interface- MetaDataFactory
 
 - 
getMetaModelClassNamepublic java.lang.String getMetaModelClassName(java.lang.String managedClassName) Description copied from interface:MetaDataFactoryGets the name of the meta-model class for the given fully-qualified managed class name.- Specified by:
- getMetaModelClassNamein interface- MetaDataFactory
 
 - 
getManagedClassNamepublic java.lang.String getManagedClassName(java.lang.String metamodelClassName) Description copied from interface:MetaDataFactoryGets the name of the managed class for the given fully-qualified meta-model class name.- Specified by:
- getManagedClassNamein interface- MetaDataFactory
 
 - 
isMetaClasspublic boolean isMetaClass(java.lang.Class<?> c) Description copied from interface:MetaDataFactoryAffirms if the given class is a meta-class.- Specified by:
- isMetaClassin interface- MetaDataFactory
 
 - 
getManagedClasspublic java.lang.Class<?> getManagedClass(java.lang.Class<?> c) Description copied from interface:MetaDataFactoryGets the managed class corresponding to the given meta-class.- Specified by:
- getManagedClassin interface- MetaDataFactory
- Returns:
- null if the given input is not a meta-class.
 
 - 
isAbstractMappingUniDirectionalpublic boolean isAbstractMappingUniDirectional(OpenJPAConfiguration conf) Description copied from interface:MetaDataDefaultsWhether the relationship in MappedSuper class must be uni-directional.- Specified by:
- isAbstractMappingUniDirectionalin interface- MetaDataDefaults
 
 - 
isNonDefaultMappingAllowedpublic boolean isNonDefaultMappingAllowed(OpenJPAConfiguration conf) Description copied from interface:MetaDataDefaultsWhether non-default mapping is allowed.- Specified by:
- isNonDefaultMappingAllowedin interface- MetaDataDefaults
 
 - 
isDefaultCascadePersistEnabledpublic java.lang.Boolean isDefaultCascadePersistEnabled() Description copied from interface:MetaDataDefaultsWhether cascade-persist was declared in the persistence unit defaults.- Specified by:
- isDefaultCascadePersistEnabledin interface- MetaDataDefaults
 
 - 
setDefaultCascadePersistEnabledpublic void setDefaultCascadePersistEnabled(java.lang.Boolean bool) - Specified by:
- setDefaultCascadePersistEnabledin interface- MetaDataDefaults
 
 - 
getDefaultSchemapublic java.lang.String getDefaultSchema() Description copied from interface:MetaDataDefaultsReturns the default schema.- Specified by:
- getDefaultSchemain interface- MetaDataDefaults
 
 - 
setDefaultSchemapublic void setDefaultSchema(java.lang.String schema) Description copied from interface:MetaDataDefaultsSets the default schema.- Specified by:
- setDefaultSchemain interface- MetaDataDefaults
 
 
- 
 
-