Class JDOMetaDataModelImpl
- java.lang.Object
-
- com.sun.jdo.api.persistence.enhancer.util.Assertion
-
- com.sun.jdo.api.persistence.enhancer.util.Support
-
- com.sun.jdo.api.persistence.enhancer.meta.JDOMetaDataModelImpl
-
- All Implemented Interfaces:
JDOMetaData
- Direct Known Subclasses:
EJBMetaDataModelImpl
public class JDOMetaDataModelImpl extends Support implements JDOMetaData
Provides the JDO meta information based on a JDO meta model.
-
-
Field Summary
Fields Modifier and Type Field Description protected Modelmodelprotected PrintWriterout-
Fields inherited from interface com.sun.jdo.api.persistence.enhancer.meta.JDOMetaData
javaLangCloneablePath, JDOExternalPath, JDOFlagsFieldName, JDOFlagsFieldSig, JDOFlagsFieldType, JDOInstanceCallbacksName, JDOInstanceCallbacksPath, JDOInstanceCallbacksSig, JDOInstanceCallbacksType, JDOPath, JDOPersistenceCapableName, JDOPersistenceCapablePath, JDOPersistenceCapableSig, JDOPersistenceCapableType, JDOPersistenceManagerName, JDOPersistenceManagerPath, JDOPersistenceManagerSig, JDOPersistenceManagerType, JDOSecondClassObjectBaseName, JDOSecondClassObjectBasePath, JDOSecondClassObjectBaseSig, JDOSecondClassObjectBaseType, JDOStateManagerFieldName, JDOStateManagerFieldSig, JDOStateManagerFieldType, JDOStateManagerName, JDOStateManagerPath, JDOStateManagerSig, JDOStateManagerType
-
-
Constructor Summary
Constructors Constructor Description JDOMetaDataModelImpl(Model model)Creates an instance.JDOMetaDataModelImpl(Model model, PrintWriter out)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetFieldNo(String classPath, String fieldName)Returns the unique field index of a declared, persistent field of a class.String[]getManagedFields(String classPath)Returns an array of field names of all declared persistent and transactional fields of a class.StringgetPersistenceCapableRootClass(String classPath)Returns the name of the persistence-capable root class of a class.StringgetSuperClass(String classPath)Returns the name of the superclass of a class.booleanisDefaultFetchGroupField(String classPath, String fieldName)Tests whether a field of a class is known to be part of the Default Fetch Group.booleanisMutableSecondClassObjectType(String classPath)Tests whether a type is known for Mutable Second Class Objects.booleanisPersistenceCapableClass(String classPath)Tests whether a class is known to be persistence-capable.booleanisPersistenceCapableRootClass(String classPath)Tests whether a class is known as a persistence-capable root class.booleanisPersistentField(String classPath, String fieldName)Tests whether a field of a class is known to be persistent.booleanisPrimaryKeyField(String classPath, String fieldName)Tests whether a field of a class is known to be Primary Key.booleanisSecondClassObjectType(String classPath)Tests whether a type is known for Second Class Objects.booleanisTransactionalField(String classPath, String fieldName)Tests whether a field of a class is known to be transactional.booleanisTransientClass(String classPath)Tests whether a class is known to be transient.protected static StringnameToPath(String className)protected static StringpathToName(String classPath)-
Methods inherited from class com.sun.jdo.api.persistence.enhancer.util.Support
getI18N, getI18N, getI18N, getI18N, getI18N, getI18N
-
-
-
-
Field Detail
-
out
protected final PrintWriter out
-
model
protected Model model
-
-
Constructor Detail
-
JDOMetaDataModelImpl
public JDOMetaDataModelImpl(Model model)
Creates an instance.
-
JDOMetaDataModelImpl
public JDOMetaDataModelImpl(Model model, PrintWriter out) throws JDOMetaDataUserException, JDOMetaDataFatalError
-
-
Method Detail
-
isTransientClass
public boolean isTransientClass(String classPath) throws JDOMetaDataUserException, JDOMetaDataFatalError
Tests whether a class is known to be transient.- Specified by:
isTransientClassin interfaceJDOMetaData- Parameters:
classPath- the JVM-qualified name of the class- Returns:
- true if this class is known to be transient; otherwise false
- Throws:
JDOMetaDataUserExceptionJDOMetaDataFatalError
-
isPersistenceCapableClass
public boolean isPersistenceCapableClass(String classPath) throws JDOMetaDataUserException, JDOMetaDataFatalError
Tests whether a class is known to be persistence-capable.- Specified by:
isPersistenceCapableClassin interfaceJDOMetaData- Parameters:
classPath- the JVM-qualified name of the class- Returns:
- true if this class is persistence-capable; otherwise false
- Throws:
JDOMetaDataUserExceptionJDOMetaDataFatalError
-
isPersistenceCapableRootClass
public boolean isPersistenceCapableRootClass(String classPath) throws JDOMetaDataUserException, JDOMetaDataFatalError
Tests whether a class is known as a persistence-capable root class.- Specified by:
isPersistenceCapableRootClassin interfaceJDOMetaData- Parameters:
classPath- the JVM-qualified name of the class- Returns:
- true if this class is persistence-capable and does not derive from another persistence-capable class; otherwise false
- Throws:
JDOMetaDataUserExceptionJDOMetaDataFatalError
-
getPersistenceCapableRootClass
public String getPersistenceCapableRootClass(String classPath) throws JDOMetaDataUserException, JDOMetaDataFatalError
Returns the name of the persistence-capable root class of a class.- Specified by:
getPersistenceCapableRootClassin interfaceJDOMetaData- Parameters:
classPath- the JVM-qualified name of the class- Returns:
- the name of the least-derived persistence-capable class that is equal to or a super class of the argument class; if the argument class is not persistence-capable, null is returned.
- Throws:
JDOMetaDataUserExceptionJDOMetaDataFatalError
-
getSuperClass
public String getSuperClass(String classPath) throws JDOMetaDataUserException, JDOMetaDataFatalError
Returns the name of the superclass of a class.- Specified by:
getSuperClassin interfaceJDOMetaData- Parameters:
classPath- the JVM-qualified name of the class- Returns:
- the name of the superclass.
- Throws:
JDOMetaDataUserExceptionJDOMetaDataFatalError
-
isSecondClassObjectType
public boolean isSecondClassObjectType(String classPath) throws JDOMetaDataUserException, JDOMetaDataFatalError
Tests whether a type is known for Second Class Objects.- Specified by:
isSecondClassObjectTypein interfaceJDOMetaData- Parameters:
classPath- the JVM-qualified name of the type- Returns:
- true if this type is known for second class objects; otherwise false
- Throws:
JDOMetaDataUserExceptionJDOMetaDataFatalError
-
isMutableSecondClassObjectType
public boolean isMutableSecondClassObjectType(String classPath) throws JDOMetaDataUserException, JDOMetaDataFatalError
Tests whether a type is known for Mutable Second Class Objects.- Specified by:
isMutableSecondClassObjectTypein interfaceJDOMetaData- Parameters:
classPath- the JVM-qualified name of the type- Returns:
- true if this type is known for mutable second class objects; otherwise false
- Throws:
JDOMetaDataUserExceptionJDOMetaDataFatalError
-
isPersistentField
public boolean isPersistentField(String classPath, String fieldName) throws JDOMetaDataUserException, JDOMetaDataFatalError
Tests whether a field of a class is known to be persistent.- Specified by:
isPersistentFieldin interfaceJDOMetaData- Parameters:
classPath- the JVM-qualified name of the classfieldName- the name of the field- Returns:
- true if this field is known to be persistent; otherwise false
- Throws:
JDOMetaDataUserExceptionJDOMetaDataFatalError
-
isTransactionalField
public boolean isTransactionalField(String classPath, String fieldName) throws JDOMetaDataUserException, JDOMetaDataFatalError
Tests whether a field of a class is known to be transactional.- Specified by:
isTransactionalFieldin interfaceJDOMetaData- Parameters:
classPath- the JVM-qualified name of the classfieldName- the name of the field- Returns:
- true if this field is known to be transactional; otherwise false
- Throws:
JDOMetaDataUserExceptionJDOMetaDataFatalError
-
isPrimaryKeyField
public boolean isPrimaryKeyField(String classPath, String fieldName) throws JDOMetaDataUserException, JDOMetaDataFatalError
Tests whether a field of a class is known to be Primary Key.- Specified by:
isPrimaryKeyFieldin interfaceJDOMetaData- Parameters:
classPath- the JVM-qualified name of the classfieldName- the name of the field- Returns:
- true if this field is known to be primary key; otherwise false
- Throws:
JDOMetaDataUserExceptionJDOMetaDataFatalError
-
isDefaultFetchGroupField
public boolean isDefaultFetchGroupField(String classPath, String fieldName) throws JDOMetaDataUserException, JDOMetaDataFatalError
Tests whether a field of a class is known to be part of the Default Fetch Group. Please note that for a relationship field, this method always returns false.- Specified by:
isDefaultFetchGroupFieldin interfaceJDOMetaData- Parameters:
classPath- the JVM-qualified name of the classfieldName- the name of the field- Returns:
- true if this field is known to be part of the default fetch group; otherwise false
- Throws:
JDOMetaDataUserExceptionJDOMetaDataFatalError
-
getFieldNo
public int getFieldNo(String classPath, String fieldName) throws JDOMetaDataUserException, JDOMetaDataFatalError
Returns the unique field index of a declared, persistent field of a class.- Specified by:
getFieldNoin interfaceJDOMetaData- Parameters:
classPath- the JVM-qualified name of the classfieldName- the name of the field- Returns:
- the non-negative, unique field index
- Throws:
JDOMetaDataUserExceptionJDOMetaDataFatalError
-
getManagedFields
public String[] getManagedFields(String classPath) throws JDOMetaDataUserException, JDOMetaDataFatalError
Returns an array of field names of all declared persistent and transactional fields of a class.- Specified by:
getManagedFieldsin interfaceJDOMetaData- Parameters:
classPath- the JVM-qualified name of the class- Returns:
- an array of all declared persistent and transactional fields of a class
- Throws:
JDOMetaDataUserExceptionJDOMetaDataFatalError
-
-