Class EJBMetaDataModelImpl
- 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
-
- com.sun.jdo.spi.persistence.support.ejb.enhancer.meta.EJBMetaDataModelImpl
-
- All Implemented Interfaces:
ExtendedJDOMetaData
,JDOMetaData
public class EJBMetaDataModelImpl extends JDOMetaDataModelImpl implements ExtendedJDOMetaData
Provide MetaDataModel Class used by CMP code generation during EJB deployment. Note that classPath is used for I/O of MetaData and className is used for I/O of Model.- Author:
- Shing Wai Chan
-
-
Field Summary
-
Fields inherited from class com.sun.jdo.api.persistence.enhancer.meta.JDOMetaDataModelImpl
model, out
-
Fields inherited from interface com.sun.jdo.api.persistence.enhancer.meta.ExtendedJDOMetaData
CHECK_READ, CHECK_WRITE, MEDIATE_READ, MEDIATE_WRITE, SERIALIZABLE
-
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 EJBMetaDataModelImpl(Model model)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getClassModifiers(String classPath)
Gets the modifiers of a class.int
getFieldFlags(String classPath, String fieldName)
Returns the field flags for a declared field of a class.int[]
getFieldFlags(String classPath, String[] fieldNames)
Returns the field flags for some declared, managed fields of a class.int
getFieldModifiers(String classPath, String fieldName)
Gets the modifiers of a field.int[]
getFieldNo(String classPath, String[] fieldNames)
Returns the unique field index of some declared, managed fields of a class.String
getFieldType(String classPath, String fieldName)
Gets the type of a field.String[]
getFieldType(String className, String[] fieldNames)
Gets the type of some fields.String
getKeyClass(String classPath)
Returns the name of the key class of a class.String[]
getKeyFields(String classPath)
Returns an array of field names of all key fields of a class.String[]
getKnownClasses()
Gets all known classnames.String[]
getKnownFields(String classPath)
Gets all known fieldnames of a class.String
getPersistenceCapableSuperClass(String classPath)
Returns the name of the persistence-capable superclass of a class.String
getSuperKeyClass(String classPath)
Returns the name of the key class of the next persistence-capable superclass that defines one.boolean
isKeyField(String classPath, String fieldName)
Returns whether a field of a class is key.boolean
isKnownNonManagedField(String classPath, String fieldName, String fieldSig)
Returns whether a field of a class is known to be non-managed.boolean
isManagedField(String classPath, String fieldName)
Returns whether a field of a class is transient transactional or persistent.boolean
isPrimaryKeyField(String classPath, String fieldName)
Tests whether a field of a class is known to be Primary Key.-
Methods inherited from class com.sun.jdo.api.persistence.enhancer.meta.JDOMetaDataModelImpl
getFieldNo, getManagedFields, getPersistenceCapableRootClass, getSuperClass, isDefaultFetchGroupField, isMutableSecondClassObjectType, isPersistenceCapableClass, isPersistenceCapableRootClass, isPersistentField, isSecondClassObjectType, isTransactionalField, isTransientClass, nameToPath, pathToName
-
Methods inherited from class com.sun.jdo.api.persistence.enhancer.util.Support
getI18N, getI18N, getI18N, getI18N, getI18N, getI18N
-
Methods inherited from class com.sun.jdo.api.persistence.enhancer.util.Assertion
affirm, affirm, affirm, affirm
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.sun.jdo.api.persistence.enhancer.meta.JDOMetaData
getFieldNo, getManagedFields, getPersistenceCapableRootClass, getSuperClass, isDefaultFetchGroupField, isMutableSecondClassObjectType, isPersistenceCapableClass, isPersistenceCapableRootClass, isPersistentField, isSecondClassObjectType, isTransactionalField, isTransientClass
-
-
-
-
Constructor Detail
-
EJBMetaDataModelImpl
public EJBMetaDataModelImpl(Model model) throws JDOMetaDataUserException, JDOMetaDataFatalError
-
-
Method Detail
-
getKnownClasses
public String[] getKnownClasses() throws JDOMetaDataUserException, JDOMetaDataFatalError
Description copied from interface:ExtendedJDOMetaData
Gets all known classnames.- Specified by:
getKnownClasses
in interfaceExtendedJDOMetaData
- Returns:
- All known classnames.
- Throws:
JDOMetaDataUserException
JDOMetaDataFatalError
-
getKnownFields
public String[] getKnownFields(String classPath) throws JDOMetaDataUserException, JDOMetaDataFatalError
Description copied from interface:ExtendedJDOMetaData
Gets all known fieldnames of a class.- Specified by:
getKnownFields
in interfaceExtendedJDOMetaData
- Parameters:
classPath
- The classname.- Returns:
- All known fieldnames.
- Throws:
JDOMetaDataUserException
JDOMetaDataFatalError
-
getFieldType
public String getFieldType(String classPath, String fieldName) throws JDOMetaDataUserException, JDOMetaDataFatalError
Description copied from interface:ExtendedJDOMetaData
Gets the type of a field.- Specified by:
getFieldType
in interfaceExtendedJDOMetaData
- Parameters:
classPath
- The classname.fieldName
- The fieldname.- Returns:
- The type of the field.
- Throws:
JDOMetaDataUserException
JDOMetaDataFatalError
-
getClassModifiers
public int getClassModifiers(String classPath) throws JDOMetaDataUserException, JDOMetaDataFatalError
Description copied from interface:ExtendedJDOMetaData
Gets the modifiers of a class. The return value is a constant of thejava.lang.reflect.Modifier
class.- Specified by:
getClassModifiers
in interfaceExtendedJDOMetaData
- Parameters:
classPath
- The classname.- Returns:
- The modifiers.
- Throws:
JDOMetaDataUserException
JDOMetaDataFatalError
- See Also:
Modifier
-
getFieldModifiers
public int getFieldModifiers(String classPath, String fieldName) throws JDOMetaDataUserException, JDOMetaDataFatalError
Description copied from interface:ExtendedJDOMetaData
Gets the modifiers of a field. The return value is a constant of thejava.lang.reflect.Modifier
class.- Specified by:
getFieldModifiers
in interfaceExtendedJDOMetaData
- Parameters:
classPath
- The classname.fieldName
- The fieldname.- Returns:
- The modifiers.
- Throws:
JDOMetaDataUserException
JDOMetaDataFatalError
- See Also:
Modifier
-
getKeyClass
public String getKeyClass(String classPath) throws JDOMetaDataUserException, JDOMetaDataFatalError
Description copied from interface:ExtendedJDOMetaData
Returns the name of the key class of a class.The following holds: (String s = getKeyClass(classPath)) != null ==> !isPersistenceCapableClass(s) && isPersistenceCapableClass(classPath)
- Specified by:
getKeyClass
in interfaceExtendedJDOMetaData
- Parameters:
classPath
- the non-null JVM-qualified name of the class- Returns:
- the name of the key class or null if there is none
- Throws:
JDOMetaDataUserException
JDOMetaDataFatalError
- See Also:
JDOMetaData.isPersistenceCapableClass(String)
-
isKnownNonManagedField
public boolean isKnownNonManagedField(String classPath, String fieldName, String fieldSig) throws JDOMetaDataUserException, JDOMetaDataFatalError
Description copied from interface:ExtendedJDOMetaData
Returns whether a field of a class is known to be non-managed.This method differs from isManagedField() in that a field may or may not be managed if its not known as non-managed. The following holds (not vice versa!): isKnownNonManagedField(classPath, fieldName) ==> !isManagedField(classPath, fieldName)
This method doesn't require the field having been declared by declareField().
- Specified by:
isKnownNonManagedField
in interfaceExtendedJDOMetaData
- Parameters:
classPath
- the non-null JVM-qualified name of the classfieldName
- the non-null name of the fieldfieldSig
- the non-null type signature of the field- Returns:
- true if this field is known to be non-managed; otherwise false
- Throws:
JDOMetaDataUserException
JDOMetaDataFatalError
- See Also:
ExtendedJDOMetaData.isManagedField(String, String)
-
isManagedField
public boolean isManagedField(String classPath, String fieldName) throws JDOMetaDataUserException, JDOMetaDataFatalError
Description copied from interface:ExtendedJDOMetaData
Returns whether a field of a class is transient transactional or persistent.A managed field must not be known as non-managed and must be either transient transactional or persistent. The following holds: isManagedField(classPath, fieldName) ==> !isKnownNonManagedField(classPath, fieldName) && (isPersistentField(classPath, fieldName) ^ isTransactionalField(classPath, fieldName))
This method requires the field having been declared by declareField().
- Specified by:
isManagedField
in interfaceExtendedJDOMetaData
- Parameters:
classPath
- the non-null JVM-qualified name of the classfieldName
- the non-null name of the field- Returns:
- true if this field is managed; otherwise false
- Throws:
JDOMetaDataUserException
JDOMetaDataFatalError
- See Also:
ExtendedJDOMetaData.isKnownNonManagedField(String, String, String)
,JDOMetaData.isPersistentField(String, String)
,JDOMetaData.isPersistenceCapableClass(String)
-
isKeyField
public boolean isKeyField(String classPath, String fieldName) throws JDOMetaDataUserException, JDOMetaDataFatalError
Description copied from interface:ExtendedJDOMetaData
Returns whether a field of a class is key.A key field must be persistent. The following holds: isKeyField(classPath, fieldName) ==> isPersistentField(classPath, fieldName) && !isDefaultFetchGroupField(classPath, fieldName)
This method requires the field having been declared by declareField().
- Specified by:
isKeyField
in interfaceExtendedJDOMetaData
- Parameters:
classPath
- the non-null JVM-qualified name of the classfieldName
- the non-null name of the field- Returns:
- true if this field is key; otherwise false
- Throws:
JDOMetaDataUserException
JDOMetaDataFatalError
- See Also:
JDOMetaData.isPersistentField(String, String)
-
isPrimaryKeyField
public boolean isPrimaryKeyField(String classPath, String fieldName) throws JDOMetaDataUserException, JDOMetaDataFatalError
Description copied from class:JDOMetaDataModelImpl
Tests whether a field of a class is known to be Primary Key.- Specified by:
isPrimaryKeyField
in interfaceJDOMetaData
- Overrides:
isPrimaryKeyField
in classJDOMetaDataModelImpl
- 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:
JDOMetaDataUserException
JDOMetaDataFatalError
-
getFieldFlags
public int getFieldFlags(String classPath, String fieldName) throws JDOMetaDataUserException, JDOMetaDataFatalError
Description copied from interface:ExtendedJDOMetaData
Returns the field flags for a declared field of a class.The following holds for the field flags: int f = getFieldFlags(classPath, fieldName); !isManagedField(classPath, fieldName) ==> (f & CHECK_READ == 0) && (f & MEDIATE_READ == 0) && (f & CHECK_WRITE == 0) && (f & MEDIATE_WRITE == 0) isTransientField(classPath, fieldName) ==> (f & CHECK_READ == 0) && (f & MEDIATE_READ == 0) && (f & CHECK_WRITE != 0) && (f & MEDIATE_WRITE == 0) isKeyField(classPath, fieldName) ==> (f & CHECK_READ == 0) && (f & MEDIATE_READ == 0) && (f & CHECK_WRITE == 0) && (f & MEDIATE_WRITE != 0) isDefaultFetchGroupField(classPath, fieldName) ==> (f & CHECK_READ != 0) && (f & MEDIATE_READ != 0) && (f & CHECK_WRITE == 0) && (f & MEDIATE_WRITE == 0) isPersistentField(classPath, fieldName) && isKeyField(classPath, fieldName) && isDefaultFetchGroupField(classPath, fieldName) ==> (f & CHECK_READ == 0) && (f & MEDIATE_READ == 0) && (f & CHECK_WRITE != 0) && (f & MEDIATE_WRITE != 0)
This method requires the field having been declared by declareField().
- Specified by:
getFieldFlags
in interfaceExtendedJDOMetaData
- Parameters:
classPath
- the non-null JVM-qualified name of the classfieldName
- the non-null name of the field- Returns:
- the field flags for this field
- Throws:
JDOMetaDataUserException
JDOMetaDataFatalError
-
getFieldFlags
public int[] getFieldFlags(String classPath, String[] fieldNames) throws JDOMetaDataUserException, JDOMetaDataFatalError
Description copied from interface:ExtendedJDOMetaData
Returns the field flags for some declared, managed fields of a class.This method requires all fields having been declared by declareField().
- Specified by:
getFieldFlags
in interfaceExtendedJDOMetaData
- Parameters:
classPath
- the non-null JVM-qualified name of the classfieldNames
- the non-null array of names of the declared fields- Returns:
- the field flags for the fields
- Throws:
JDOMetaDataUserException
JDOMetaDataFatalError
-
getFieldType
public String[] getFieldType(String className, String[] fieldNames) throws JDOMetaDataUserException, JDOMetaDataFatalError
Description copied from interface:ExtendedJDOMetaData
Gets the type of some fields.- Specified by:
getFieldType
in interfaceExtendedJDOMetaData
- Parameters:
className
- The classname.fieldNames
- The fieldnames.- Returns:
- The type of the fields.
- Throws:
JDOMetaDataUserException
JDOMetaDataFatalError
-
getFieldNo
public int[] getFieldNo(String classPath, String[] fieldNames) throws JDOMetaDataUserException, JDOMetaDataFatalError
Description copied from interface:ExtendedJDOMetaData
Returns the unique field index of some declared, managed fields of a class.This method requires all fields having been declared by declareField().
- Specified by:
getFieldNo
in interfaceExtendedJDOMetaData
- Parameters:
classPath
- the non-null JVM-qualified name of the classfieldNames
- the non-null array of names of the declared fields- Returns:
- the non-negative, unique field indices
- Throws:
JDOMetaDataUserException
JDOMetaDataFatalError
-
getKeyFields
public String[] getKeyFields(String classPath) throws JDOMetaDataUserException, JDOMetaDataFatalError
Description copied from interface:ExtendedJDOMetaData
Returns an array of field names of all key fields of a class.This method requires all fields having been declared by declareField().
- Specified by:
getKeyFields
in interfaceExtendedJDOMetaData
- Parameters:
classPath
- the non-null JVM-qualified name of the class- Returns:
- an array of all declared key fields of a class
- Throws:
JDOMetaDataUserException
JDOMetaDataFatalError
-
getPersistenceCapableSuperClass
public String getPersistenceCapableSuperClass(String classPath) throws JDOMetaDataUserException, JDOMetaDataFatalError
Description copied from interface:ExtendedJDOMetaData
Returns the name of the persistence-capable superclass of a class.The following holds: (String s = getPersistenceCapableSuperClass(classPath)) != null ==> isPersistenceCapableClass(classPath) && !isPersistenceCapableRootClass(classPath)
- Specified by:
getPersistenceCapableSuperClass
in interfaceExtendedJDOMetaData
- Parameters:
classPath
- the non-null JVM-qualified name of the class- Returns:
- the name of the PC superclass or null if there is none
- Throws:
JDOMetaDataUserException
JDOMetaDataFatalError
- See Also:
JDOMetaData.isPersistenceCapableClass(String)
,JDOMetaData.getPersistenceCapableRootClass(String)
-
getSuperKeyClass
public String getSuperKeyClass(String classPath) throws JDOMetaDataUserException, JDOMetaDataFatalError
Description copied from interface:ExtendedJDOMetaData
Returns the name of the key class of the next persistence-capable superclass that defines one.The following holds: (String s = getSuperKeyClass(classPath)) != null ==> !isPersistenceCapableClass(s) && isPersistenceCapableClass(classPath) && !isPersistenceCapableRootClass(classPath)
- Specified by:
getSuperKeyClass
in interfaceExtendedJDOMetaData
- Parameters:
classPath
- the non-null JVM-qualified name of the class- Returns:
- the name of the key class or null if there is none
- Throws:
JDOMetaDataUserException
JDOMetaDataFatalError
- See Also:
ExtendedJDOMetaData.getKeyClass(String)
,ExtendedJDOMetaData.getPersistenceCapableSuperClass(String)
-
-