Overview | Package | Class | Tree | Serialized | Deprecated | Index | Help
| SolarMetric Kodo JDO 2.4.3 generated on March 27 2003
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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:

- Does not support fully-qualified field names, or differentiation for subclasses with declared fields of the same name as superclass fields.
- Does not support package-level vendor extensions.
- Does not support nested vendor extensions.

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.

Method Summary
`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.
`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.
`boolean` | `hasSecondClassObjectFields()`
`protected static boolean` | `isCached(Class type)` Return `true` if the metadata for `type` has already been parsed.
`boolean` | `isEnhanced()` Returns true if the class has been enhanced.
`boolean` | `requiresExtent()` Return true if the type requires management via 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.

Method Detail

### 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:
  - `ID_DATASTORE`: identity managed by the data store and independent of the fields of the instance
  - `ID_APPLICATION`: identity managed by the application and defined by one or more fields of the instance
  - `ID_NONE`: identity managed by the data store to guarantee uniqueness in the JVM, but not necessarily in the data store; this is rarely used
  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.

### toString

    public String toString()

  Overrides:
    `toString` in class `Object`

### hasSecondClassObjectFields

    public final boolean hasSecondClassObjectFields()

Overview | Package | Class | Tree | Serialized | Deprecated | Index | Help
| SolarMetric Kodo JDO 2.4.3 generated on March 27 2003
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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