SolarMetric Kodo JDO 3.3.5 generated on August 31 2005

kodo.meta
Interface ClassMetaData

All Superinterfaces:
Commentable, Comparable, Extensions, SourceTracker
All Known Subinterfaces:
ClassMapping
All Known Implementing Classes:
DelegatingClassMetaData

public interface ClassMetaData
extends Extensions, Comparable, SourceTracker, Commentable

Contains JDO meta information about a persistent type. This metadata is available both at enhancement time and runtime.

Along with simple bean methods for getting basic attributes of the metadata, the following methods can be used before resolve() has been called: getDeclaredField(int), getDeclaredField(String), and getDeclaredFields(). If the superclass metadata has been set or this is a base class, getPrimaryKeyFields() can also be used before resolve.


Field Summary
static String DATA_CACHE
          Extension key used to indicate that this class should be stored in a named L2 cache.
static String DATA_CACHE_TIMEOUT
          Extension key used to set an L2 cache timeout value for the class.
static int DETACH_FALSE
          This class is not detachable.
static String DETACH_OID_FIELD
          Extension to indicate which field will be used to store the stringified object id.
static int DETACH_SERIALIZE
          This class is detachable, and automatically detaches on serialize.
static String DETACH_STATE_FIELD
          Extension to indicate which field will be used to store the version object.
static int DETACH_TRUE
          This class is detachable.
static String DETACHABLE
          Extension used to mark this class as being capable of being detached.
static String[] EXTENSION_KEYS
          The list of all the recognized extension keys.
static int ID_APPLICATION
          Constant representing the 'application' JDO identity type.
static int ID_DATASTORE
          Constant representing the 'datastore' JDO identity type.
static int ID_NONDURABLE
          Constant representing the 'nondurable' JDO identity type.
static String LOCK_GROUPS
          Extension key that explicitly lists lock group names used by subclasses of a least-derived type.
static String SUBCLASS_FETCH_MODE
          Extension key used to specify whether the subclass fetch mode for this type.
static int VALIDATE_ALL
          Constant to validate all metadata.
static int VALIDATE_NONE
          Constant to not validate any metadata.
static int VALIDATE_NORESOLVE
          Constant to not even resolve metadata; useful when building up new metadata in dev tools.
static int VALIDATE_RUNTIME
          Runtime validation.
static int VALIDATE_UNENHANCED
          Constant to validate only metadata for unenhanced classes.
 
Method Summary
 void addDeclaredField(FieldMetaData field)
          Add a persistent or transactional field to this class.
 DataCache getDataCache()
          Return the data cache for this class, or null if it is not cachable.
 String getDataCacheName()
          Return the value of the DATA_CACHE extension.
 int getDataCacheTimeout()
          Return the value of the DATA_CACHE_TIMEOUT extension, or the system default if no extension is present.
 FieldMetaData getDeclaredField(int index)
          Return the metadata for the persistent or transactional field with the given relative index.
 FieldMetaData getDeclaredField(String name)
          Return the metadata for the persistent or transactional field with the given name, without including superclass fields.
 FieldMetaData[] getDeclaredFields()
          Return only the fields for this class, without superclass fields.
 FieldMetaData[] getDeclaredUnmanagedFields()
          Return any fields that were added as non-managed.
 FieldMetaData[] getDefaultFetchGroupFields()
          Return the list of fields in the default fetch group, including superclass fields, or an empty array if none.
 Class getDescribedType()
          Return the persistence capable class described by this metadata.
 int getDetachable()
          The detach constant for this class.
 String getDetachObjectId()
          The name of the detach object id field, or null if none.
 Field getDetachObjectIdField()
          Return the detach object id field, or null if none.
 String getDetachState()
          The name of the detach state field, or null if none.
 Field getDetachStateField()
          Return the detach state field, or null if none.
 FieldMetaData getField(int index)
          Return the metadata for the persistent or transactional field with the given absolute index.
 FieldMetaData getField(String name)
          Return the metadata for the persistent or transactional field with the given name.
 FieldMetaData[] getFields()
          Return all field metadatas, including superclass fields.
 FieldMetaData[] getFieldsInListingOrder()
          Return all field metadatas, including superclass fields, in the order that they are encountered during parsing.
 int getIdentityType()
          Return the type of JDO identity being used.
 ClassMetaData getLeastDerivedMetaData()
          Return the metadata representing the least-derived persistence-capable type in this class hierarchy.
 Class getObjectIdClass()
          Return the metadata-specified class to use for the object ID, or null if not specified.
 Class[] getPCSubclasses()
          Return the known persistence capable subclasses of the described type, or empty array if none.
 ClassMetaData[] getPCSubclassMetaDatas()
          Return the metadata for the known persistence capable subclasses of the described type, or empty array if none.
 Class getPCSuperclass()
          Return the persistence capable superclass of the described type, or null if the metadata did not specify one.
 ClassMetaData getPCSuperclassMetaData()
          Return the metadata for the persistence capable superclass of the described type, or null if the metadata did not specify one.
 ClassLoader getPMClassLoader()
          The class persistence manager loader used when parsing this metadata.
 FieldMetaData[] getPrimaryKeyFields()
          Return primary key fields, or empty array if none.
 JDOMetaDataRepository getRepository()
          Return the owning repository.
 boolean getRequiresExtent()
          Return true if the type requires management via extent.
 File getSourceFile()
          Return the source file the metadata was parsed from, if any.
 int getSubclassFetchMode()
          The subclass fetch mode, as one of the eager constants in FetchConfiguration.
 int getValidate()
          Return the validation level.
 void invalidateResolve()
          For implementation use.
 boolean isEnhanced()
          Returns true if the class has been enhanced.
 boolean isInstanceCallbacks()
          Return true if the class implements InstanceCallbacks.
 boolean isMemberField(String field)
          Return whether the given name represents a member field of this class, including superclass fields.
 boolean isResolved()
          For implementation use.
 boolean isSingleFieldIdentity()
          Return true if using single field identity.
 boolean removeDeclaredField(FieldMetaData field)
          Remove the given field from management.
 void resolve()
          For implementation use.
 void setDataCacheName(String cacheName)
          Set the value of the DATA_CACHE extension.
 void setDataCacheTimeout(int timeout)
          Set the value of the DATA_CACHE_TIMEOUT standard extension.
 void setDescribedType(Class type)
          Return the persistence capable class described by this metadata.
 void setDetachable(int detachable)
          The detach constant for this class.
 void setDetachObjectId(String field)
          The name of the detach object id field, or null if none.
 void setDetachState(String field)
          The name of the detach state field, or null if none.
 void setIdentityType(int type)
          Set the type of JDO identity used by this class.
 void setObjectIdClass(Class cls)
          Set the metadata-specified class to use for the object ID.
 void setPCSuperclass(Class pc)
          Set the persistence capable superclass of the described type.
 void setPCSuperclassMetaData(ClassMetaData meta)
          Set the metadata for this class' superclass.
 void setPMClassLoader(ClassLoader loader)
          The class persistence manager loader used when parsing this metadata.
 void setRepository(JDOMetaDataRepository repos)
          Set the owning repository.
 void setRequiresExtent(boolean req)
          Set whether the type requires extent management.
 void setSingleFieldIdentity(boolean single)
          Set whether this class should use single field identity.
 void setSourceFile(File file)
          Set the source file the metadata was parsed from.
 void setSubclassFetchMode(int mode)
          The subclass fetch mode, as one of the eager constants in FetchConfiguration.
 void setValidate(int validate)
          Set the validation level.
 
Methods inherited from interface kodo.meta.Extensions
addExtension, addExtension, addExtensionKeys, getBooleanExtension, getBooleanExtension, getDoubleExtension, getDoubleExtension, getEmbeddedExtensions, getEmbeddedExtensions, getExtensionComments, getExtensionKeys, getExtensionKeys, getExtensionVendors, getIntExtension, getIntExtension, getObjectExtension, getObjectExtension, getStringExtension, getStringExtension, hasExtension, hasExtension, isEmpty, removeEmbeddedExtensions, removeEmbeddedExtensions, removeExtension, removeExtension
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface com.solarmetric.meta.SourceTracker
getTrackedResourceName
 
Methods inherited from interface kodo.meta.Commentable
getComments
 

Field Detail

ID_NONDURABLE

public static final int ID_NONDURABLE
Constant representing the 'nondurable' JDO identity type.

ID_DATASTORE

public static final int ID_DATASTORE
Constant representing the 'datastore' JDO identity type.

ID_APPLICATION

public static final int ID_APPLICATION
Constant representing the 'application' JDO identity type.

VALIDATE_ALL

public static final int VALIDATE_ALL
Constant to validate all metadata.

VALIDATE_UNENHANCED

public static final int VALIDATE_UNENHANCED
Constant to validate only metadata for unenhanced classes.

VALIDATE_NONE

public static final int VALIDATE_NONE
Constant to not validate any metadata.

VALIDATE_NORESOLVE

public static final int VALIDATE_NORESOLVE
Constant to not even resolve metadata; useful when building up new metadata in dev tools.

VALIDATE_RUNTIME

public static final int VALIDATE_RUNTIME
Runtime validation. Requires that all classes are enhanced, and performs extra field resolution steps.

DETACH_FALSE

public static final int DETACH_FALSE
This class is not detachable.

DETACH_TRUE

public static final int DETACH_TRUE
This class is detachable.

DETACH_SERIALIZE

public static final int DETACH_SERIALIZE
This class is detachable, and automatically detaches on serialize.

DATA_CACHE

public static final String DATA_CACHE
Extension key used to indicate that this class should be stored in a named L2 cache.

DATA_CACHE_TIMEOUT

public static final String DATA_CACHE_TIMEOUT
Extension key used to set an L2 cache timeout value for the class. Use a value of -1 to indicate that this class should not be expired.

DETACHABLE

public static final String DETACHABLE
Extension used to mark this class as being capable of being detached.

DETACH_OID_FIELD

public static final String DETACH_OID_FIELD
Extension to indicate which field will be used to store the stringified object id.

DETACH_STATE_FIELD

public static final String DETACH_STATE_FIELD
Extension to indicate which field will be used to store the version object.

LOCK_GROUPS

public static final String LOCK_GROUPS
Extension key that explicitly lists lock group names used by subclasses of a least-derived type. String value is lock-groups.

SUBCLASS_FETCH_MODE

public static final String SUBCLASS_FETCH_MODE
Extension key used to specify whether the subclass fetch mode for this type. Defaults to the superclass setting, or to the kodo.SubclassFetchMode property if no superclass.

EXTENSION_KEYS

public static final String[] EXTENSION_KEYS
The list of all the recognized extension keys.
Method Detail

getPMClassLoader

public ClassLoader getPMClassLoader()
The class persistence manager loader used when parsing this metadata. The class metadata should use this loader when loading metadata for its superclass and field types.

setPMClassLoader

public void setPMClassLoader(ClassLoader loader)
The class persistence manager loader used when parsing this metadata. The class metadata should use this loader when loading metadata for its superclass and field types.

getValidate

public int getValidate()
Return the validation level.

setValidate

public void setValidate(int validate)
Set the validation level.

getRepository

public JDOMetaDataRepository getRepository()
Return the owning repository.

setRepository

public void setRepository(JDOMetaDataRepository repos)
Set the owning repository.

getSourceFile

public File getSourceFile()
Return the source file the metadata was parsed from, if any.
Specified by:
getSourceFile in interface SourceTracker

setSourceFile

public void setSourceFile(File file)
Set the source file the metadata was parsed from.

getDescribedType

public Class getDescribedType()
Return the persistence capable class described by this metadata.

setDescribedType

public void setDescribedType(Class type)
Return the persistence capable class described by this metadata.

getPCSuperclass

public Class getPCSuperclass()
Return the persistence capable superclass of the described type, or null if the metadata did not specify one.

setPCSuperclass

public void setPCSuperclass(Class pc)
Set the persistence capable superclass of the described type.

getPCSuperclassMetaData

public ClassMetaData getPCSuperclassMetaData()
Return the metadata for the persistence capable superclass of the described type, or null if the metadata did not specify one.

setPCSuperclassMetaData

public void setPCSuperclassMetaData(ClassMetaData meta)
Set the metadata for this class' superclass.

getLeastDerivedMetaData

public ClassMetaData getLeastDerivedMetaData()
Return the metadata representing the least-derived persistence-capable type in this class hierarchy. If this type has no persistence-capable superclasses, returns this.

getPCSubclasses

public Class[] getPCSubclasses()
Return the known persistence capable subclasses of the described type, or empty array if none.

getPCSubclassMetaDatas

public ClassMetaData[] getPCSubclassMetaDatas()
Return the metadata for the known persistence capable subclasses of the described type, or empty array if none.

getIdentityType

public int getIdentityType()
Return the type of JDO identity being used. This will be one of: If unspecified, defaults to ID_DATASTORE.

setIdentityType

public void setIdentityType(int type)
Set the type of JDO identity used by this class.
See Also:
getIdentityType()

getObjectIdClass

public Class getObjectIdClass()
Return the metadata-specified class to use for the object ID, or null if not specified.

setObjectIdClass

public void setObjectIdClass(Class cls)
Set the metadata-specified class to use for the object ID.

setSingleFieldIdentity

public void setSingleFieldIdentity(boolean single)
Set whether this class should use single field identity.

isSingleFieldIdentity

public boolean isSingleFieldIdentity()
Return true if using single field identity.

getRequiresExtent

public boolean getRequiresExtent()
Return true if the type requires management via extent. If false, the PersistenceManager.getExtent(java.lang.Class, boolean) method cannot be used for this class. Defaults to true.

setRequiresExtent

public void setRequiresExtent(boolean req)
Set whether the type requires extent management.

getFields

public FieldMetaData[] getFields()
Return all field metadatas, including superclass fields.

getFieldsInListingOrder

public FieldMetaData[] getFieldsInListingOrder()
Return all field metadatas, including superclass fields, in the order that they are encountered during parsing. The position of the field meta data in this array is not the same as the value returned by FieldMetaData.getIndex(), but rather is related to FieldMetaData.getListingIndex().

getDeclaredFields

public FieldMetaData[] getDeclaredFields()
Return only the fields for this class, without superclass fields.

getPrimaryKeyFields

public FieldMetaData[] getPrimaryKeyFields()
Return primary key fields, or empty array if none.

getDefaultFetchGroupFields

public FieldMetaData[] getDefaultFetchGroupFields()
Return the list of fields in the default fetch group, including superclass fields, or an empty array if none.

getField

public FieldMetaData getField(int index)
Return the metadata for the persistent or transactional field with the given absolute index.
Returns:
the field's metadata, or null if not found

getDeclaredField

public FieldMetaData getDeclaredField(int index)
Return the metadata for the persistent or transactional field with the given relative index.
Returns:
the field's metadata, or null if not found

getField

public FieldMetaData getField(String name)
Return the metadata for the persistent or transactional field with the given name. This method can only be used at runtime.
Returns:
the field's metadata, or null if not found

getDeclaredField

public FieldMetaData getDeclaredField(String name)
Return the metadata for the persistent or transactional field with the given name, without including superclass fields.
Returns:
the field's metadata, or null if not found

getDeclaredUnmanagedFields

public FieldMetaData[] getDeclaredUnmanagedFields()
Return any fields that were added as non-managed. All other methods to get fields return only those that are managed.

isMemberField

public boolean isMemberField(String field)
Return whether the given name represents a member field of this class, including superclass fields. The field can be managed or unmanaged, instance or static.

addDeclaredField

public void addDeclaredField(FieldMetaData field)
Add a persistent or transactional field to this class.

removeDeclaredField

public boolean removeDeclaredField(FieldMetaData field)
Remove the given field from management.
Returns:
true if the field was removed, false otherwise

isEnhanced

public boolean isEnhanced()
Returns true if the class has been enhanced.

isInstanceCallbacks

public boolean isInstanceCallbacks()
Return true if the class implements InstanceCallbacks.

getDataCacheName

public String getDataCacheName()
Return the value of the DATA_CACHE extension.

setDataCacheName

public void setDataCacheName(String cacheName)
Set the value of the DATA_CACHE extension. Use null to remove the extension.

getDataCacheTimeout

public int getDataCacheTimeout()
Return the value of the DATA_CACHE_TIMEOUT extension, or the system default if no extension is present.

setDataCacheTimeout

public void setDataCacheTimeout(int timeout)
Set the value of the DATA_CACHE_TIMEOUT standard extension. Use Integer.MAX_VALUE to remove the extension.

getDataCache

public DataCache getDataCache()
Return the data cache for this class, or null if it is not cachable.

getDetachable

public int getDetachable()
The detach constant for this class.

setDetachable

public void setDetachable(int detachable)
The detach constant for this class.

getDetachObjectId

public String getDetachObjectId()
The name of the detach object id field, or null if none.

setDetachObjectId

public void setDetachObjectId(String field)
The name of the detach object id field, or null if none.

getDetachObjectIdField

public Field getDetachObjectIdField()
Return the detach object id field, or null if none.

getDetachState

public String getDetachState()
The name of the detach state field, or null if none.

setDetachState

public void setDetachState(String field)
The name of the detach state field, or null if none.

getDetachStateField

public Field getDetachStateField()
Return the detach state field, or null if none.

getSubclassFetchMode

public int getSubclassFetchMode()
The subclass fetch mode, as one of the eager constants in FetchConfiguration.

setSubclassFetchMode

public void setSubclassFetchMode(int mode)
The subclass fetch mode, as one of the eager constants in FetchConfiguration.

isResolved

public boolean isResolved()
For implementation use. Return whether this metadata has been resolved.

invalidateResolve

public void invalidateResolve()
For implementation use. Invalidate resolved data.

resolve

public void resolve()
For implementation use. This method resolves superclass information, caches fields, and resolves fields that might be other first class objects. It requires access to a respository. It can access other class metadata through the repository, but cannot access field metadata for those classes. It can, however, access superclass field metadata.

SolarMetric Kodo JDO 3.3.5 generated on August 31 2005

Copyright 2001,2002 SolarMetric, Inc. All Rights Reserved.