SolarMetric Kodo JDO 2.5.8 generated on January 11 2004

com.solarmetric.kodo.meta
Class ClassMetaData

java.lang.Object
  |
  +--com.solarmetric.kodo.meta.Extensions
        |
        +--com.solarmetric.kodo.meta.ClassMetaData

public class ClassMetaData
extends Extensions

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

The XML metadata for each JDO class must be obtainable as a resource from the ClassResolver of the class, and must be named either [class-name].jdo, if it applies only the given class, or, if grouped with other classes in the same package, [package-name].jdo. To group multiple packages together, place a file called system.jdo at the top level of the CLASSPATH.

This implementation currently differs from the JDO 1.0 Specification specification in the following ways:


Field Summary
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 int ID_NONE
          Deprecated. Use ID_NONDURABLE instead.
 
Constructor Summary
(package private) ClassMetaData(Class type)
          Constructor.
 
Method Summary
(package private) static void ()
           
(package private)  FieldMetaData addField(String name, Class type)
           
(package private)  void checkFinished()
           
 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.
 Class getDescribedType()
          Return the persistence capable class described by this metadata.
 Set getFetchGroup(FieldMetaData fmd)
          Return an unmodifiable set of all fields in fmd's fetch group.
 Set getFetchGroup(String name)
          Return an unmodifiable set of all fields in the fetch group identified by name.
 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.
 int getIdentityType()
          Return the type of JDO identity being used.
static ClassMetaData getInstance(Class type)
          Deprecated.  
static ClassMetaData getInstance(Class type, ClassResolver resolver)
          Factory method to obtain metadata for a given persistent type.
static ClassMetaData getInstance(Class type, ClassResolver loader, JDOMetaDataParser parser, boolean validate)
          Factory method to obtain metadata for a given persistent type.
static ClassMetaData getInstance(Class type, PersistenceManagerImpl pm)
          Factory method to obtain metadata for a given persistent type.
 Class getObjectIdClass()
          Return the metadata-specified class to use for the object ID, or null if not specified.
 Class getPersistenceCapableSuperclass()
          Return the persistence capable superclass of the described type, or null if the metadata did not specify one.
static Class getPersistentType(Class type)
           
 boolean hasSecondClassObjectFields()
           
protected static boolean isCached(Class type)
          Return true if the metadata for type has already been parsed.
(package private) static boolean isDefaultPersistent(Class type)
           
 boolean isDescribedType(Class check)
           
 boolean isEnhanced()
          Returns true if the class has been enhanced.
 boolean requiresExtent()
          Return true if the type requires management via extent.
(package private)  void setIdentityType(int type)
           
(package private)  void setObjectIdClass(Class type)
           
(package private)  void setPersistenceCapableSuperclass(Class superType)
           
(package private)  void setRequiresExtent(boolean extent)
           
 String toString()
           
 
Methods inherited from class com.solarmetric.kodo.meta.Extensions
addExtension, addExtension, getBooleanExtension, getBooleanExtension, getDoubleExtension, getDoubleExtension, getIntExtension, getIntExtension, getObjectExtension, getObjectExtension, getStringExtension, getStringExtension, hasExtension, hasExtension, removeExtension, removeExtension
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ID_NONDURABLE

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

ID_NONE

public static final int ID_NONE
Deprecated. Use ID_NONDURABLE instead.

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.
Constructor Detail

ClassMetaData

ClassMetaData(Class type)
Constructor.
Method Detail

static void ()

getInstance

public static ClassMetaData getInstance(Class type)
Deprecated.  

Factory method to obtain metadata for a given persistent type. This can be used at either enhancement time or runtime; if used at enhancement time the metadata will be validated.

Because this method is not parameterized with a PersistenceManager or ClassResolver, classes may not be resolved according to the JDO specification. One of the other getInstance methods should be used instead of this, especially when used at runtime.

Returns:
the metadata for the given type, or null if no metadata

getInstance

public static ClassMetaData getInstance(Class type,
                                        PersistenceManagerImpl pm)
Factory method to obtain metadata for a given persistent type. This can be used at either enhancement time or runtime; if used at enhancement time the metadata will be validated.
Returns:
the metadata for the given type, or null if no metadata

getInstance

public static ClassMetaData getInstance(Class type,
                                        ClassResolver resolver)
Factory method to obtain metadata for a given persistent type. This can be used at either enhancement time or runtime; if used at enhancement time the metadata will be validated.
Returns:
the metadata for the given type, or null if no metadata

getInstance

public static ClassMetaData getInstance(Class type,
                                        ClassResolver loader,
                                        JDOMetaDataParser parser,
                                        boolean validate)
Factory method to obtain metadata for a given persistent type. The validation of the metadata can be controlled through the validate parameter, and subclasses of the standard JDOMetaDataParser can be given to parse the XML if needed. If given as null, the defualt parser will be used. This method is mean for use primarily by tools that may need to have stricter control over metadata parsing.

isCached

protected static boolean isCached(Class type)
Return true if the metadata for type has already been parsed.

getDescribedType

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

getPersistenceCapableSuperclass

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

getIdentityType

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

getObjectIdClass

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

requiresExtent

public final boolean requiresExtent()
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.

getFields

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

getDeclaredFields

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

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

isEnhanced

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

isDefaultPersistent

static final boolean isDefaultPersistent(Class type)

setPersistenceCapableSuperclass

final void setPersistenceCapableSuperclass(Class superType)

setIdentityType

final void setIdentityType(int type)

setObjectIdClass

final void setObjectIdClass(Class type)

setRequiresExtent

final void setRequiresExtent(boolean extent)

addField

FieldMetaData addField(String name,
                       Class type)

checkFinished

final void checkFinished()

toString

public String toString()
Overrides:
toString in class Object

hasSecondClassObjectFields

public final boolean hasSecondClassObjectFields()

getFetchGroup

public final Set getFetchGroup(FieldMetaData fmd)
Return an unmodifiable set of all fields in fmd's fetch group. This may include fields in subclasses. If there is no fetch group corresponding to fmd, return an empty set.

getFetchGroup

public final Set getFetchGroup(String name)
Return an unmodifiable set of all fields in the fetch group identified by name. This may include fields in subclasses. If there is no fetch group corresponding to name, return an empty set.

getPersistentType

public static Class getPersistentType(Class type)

isDescribedType

public boolean isDescribedType(Class check)

SolarMetric Kodo JDO 2.5.8 generated on January 11 2004

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