Overview | Package | Class | Tree | Deprecated | Index | Help
| SolarMetric Kodo JDO 2.5.0 Reverse Schema Tool
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.solarmetric.rd.kodo.meta
Interface ClassMetaData

All Superinterfaces:
  java.lang.Comparable, Extensions, SourceTracker

All Known Implementing Classes:
  ClassMapping, ClassMetaDataImpl

public interface ClassMetaData
extends Extensions, java.lang.Comparable, SourceTracker

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

Metadata can be created without a `JDOMetaDataRepository`, but methods that would require access to metadata for related classes will throw an exception.

Field Summary
`static java.lang.String` | `CAN_CACHE` Extension key used to mark whether the instances of a persistent class can reside in the L2 cache (if any).
`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_NONE` Constant representing the 'none' JDO identity type.

Method Summary
`void` | `addDeclaredField(com.solarmetric.rd.kodo.meta.FieldMetaData field)` Add a persistent or transactional field to this class.
`boolean` | `getCanCache()` Return true if the `CAN_CACHE` extension key is true.
`com.solarmetric.rd.kodo.meta.FieldMetaData` | `getDeclaredField(int index)` Return the metadata for the persistent or transactional field with the given relative index.
`com.solarmetric.rd.kodo.meta.FieldMetaData` | `getDeclaredField(java.lang.String name)` Return the metadata for the persistent or transactional field with the given name, without including superclass fields.
`com.solarmetric.rd.kodo.meta.FieldMetaData[]` | `getDeclaredFields()` Return only the fields for this class, without superclass fields.
`com.solarmetric.rd.kodo.meta.FieldMetaData[]` | `getDeclaredUnmanagedFields()` Return any fields that were added as non-managed.
`java.lang.Class` | `getDescribedType()` Return the persistence capable class described by this metadata.
`com.solarmetric.rd.kodo.meta.FieldMetaData` | `getField(int index)` Return the metadata for the persistent or transactional field with the given absolute index.
`com.solarmetric.rd.kodo.meta.FieldMetaData` | `getField(java.lang.String name)` Return the metadata for the persistent or transactional field with the given name.
`com.solarmetric.rd.kodo.meta.FieldMetaData[]` | `getFields()` Return all field metadatas, including superclass fields.
`int` | `getIdentityType()` Return the type of JDO identity being used.
`java.lang.Class` | `getObjectIdClass()` Return the metadata-specified class to use for the object ID, or null if not specified.
`java.lang.Class` | `getPCSuperclass()` Return the persistence capable superclass of the described type, or null if the metadata did not specify one.
`com.solarmetric.rd.kodo.meta.ClassMetaData` | `getPCSuperclassMetaData()` Return the metadata for the persistence capable superclass of the described type, or null if the metadata did not specify one.
`java.lang.ClassLoader` | `getPMClassLoader()` The class persistence manager loader used when parsing this metadata.
`com.solarmetric.rd.kodo.meta.FieldMetaData[]` | `getPrimaryKeyFields()` Return primary key fields, or empty array if none.
`com.solarmetric.rd.kodo.meta.JDOMetaDataRepository` | `getRepository()` Return the owning repository.
`boolean` | `getRequiresExtent()` Return true if the type requires management via extent.
`java.io.File` | `getSourceFile()` Return the source file the metadata was parsed from, if any.
`boolean` | `getValidate()` Return true if the metadata will validate itself when resolved.
`void` | `invalidateResolve()` For implemntation use.
`boolean` | `isEnhanced()` Returns true if the class has been enhanced.
`boolean` | `isInstanceCallbacks()` Return true if the class implements `InstanceCallbacks`.
`boolean` | `removeDeclaredField(com.solarmetric.rd.kodo.meta.FieldMetaData field)` Remove the given field from management.
`boolean` | `resolve()` For implementation use.
`void` | `setCanCache(boolean cacheable)` Set the value of the `CAN_CACHE` standard extension.
`void` | `setDescribedType(java.lang.Class type)` Return the persistence capable class described by this metadata.
`void` | `setIdentityType(int type)` Set the type of JDO identity used by this class.
`void` | `setObjectIdClass(java.lang.Class cls)` Set the metadata-specified class to use for the object ID.
`void` | `setPCSuperclass(java.lang.Class pc)` Set the persistence capable superclass of the described type.
`void` | `setPMClassLoader(java.lang.ClassLoader loader)` The class persistence manager loader used when parsing this metadata.
`void` | `setRepository(com.solarmetric.rd.kodo.meta.JDOMetaDataRepository repos)` Set the owning repository.
`void` | `setRequiresExtent(boolean req)` Set whether the type requires extent management.
`void` | `setSourceFile(java.io.File file)` Set the source file the metadata was parsed from.
`void` | `setValidate(boolean validate)` Set to false to turn off validation on resolve.

Methods inherited from interface com.solarmetric.rd.kodo.meta.Extensions
`addExtension, addExtension, getBooleanExtension, getBooleanExtension, getDoubleExtension, getDoubleExtension, getEmbeddedExtensions, getEmbeddedExtensions, getExtensionKeys, getExtensionKeys, getExtensionVendors, getIntExtension, getIntExtension, getObjectExtension, getObjectExtension, getStringExtension, getStringExtension, hasExtension, hasExtension, isEmpty, removeEmbeddedExtensions, removeEmbeddedExtensions, removeExtension, removeExtension`

Methods inherited from interface java.lang.Comparable
`compareTo`

Field Detail

### ID_NONE

    public static final int ID_NONE

  Constant representing the 'none' JDO identity type.

  See Also:
    Constant Field Values

### ID_DATASTORE

    public static final int ID_DATASTORE

  Constant representing the 'datastore' JDO identity type.

  See Also:
    Constant Field Values

### ID_APPLICATION

    public static final int ID_APPLICATION

  Constant representing the 'application' JDO identity type.

  See Also:
    Constant Field Values

### CAN_CACHE

    public static final java.lang.String CAN_CACHE

  Extension key used to mark whether the instances of a persistent class can reside in the L2 cache (if any). Legal values are `true` and `false`. Defaults to `true`.

  See Also:
    Constant Field Values

Method Detail

### getPMClassLoader

    public java.lang.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(java.lang.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 boolean getValidate()

  Return true if the metadata will validate itself when resolved.

### setValidate

    public void setValidate(boolean validate)

  Set to false to turn off validation on resolve.

### getRepository

    public com.solarmetric.rd.kodo.meta.JDOMetaDataRepository getRepository()

  Return the owning repository.

### setRepository

    public void setRepository(com.solarmetric.rd.kodo.meta.JDOMetaDataRepository repos)

  Set the owning repository.

### getSourceFile

    public java.io.File getSourceFile()

  Return the source file the metadata was parsed from, if any.

  Specified by:
    `getSourceFile` in interface `SourceTracker`

### setSourceFile

    public void setSourceFile(java.io.File file)

  Set the source file the metadata was parsed from.

### getDescribedType

    public java.lang.Class getDescribedType()

  Return the persistence capable class described by this metadata.

### setDescribedType

    public void setDescribedType(java.lang.Class type)

  Return the persistence capable class described by this metadata.

### getPCSuperclass

    public java.lang.Class getPCSuperclass()

  Return the persistence capable superclass of the described type, or null if the metadata did not specify one.

### setPCSuperclass

    public void setPCSuperclass(java.lang.Class pc)

  Set the persistence capable superclass of the described type.

### getPCSuperclassMetaData

    public com.solarmetric.rd.kodo.meta.ClassMetaData getPCSuperclassMetaData()

  Return the metadata for the persistence capable superclass of the described type, or null if the metadata did not specify one.

### getIdentityType

    public 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`.

### setIdentityType

    public void setIdentityType(int type)

  Set the type of JDO identity used by this class.

  See Also:
    `getIdentityType()`

### getObjectIdClass

    public java.lang.Class getObjectIdClass()

  Return the metadata-specified class to use for the object ID, or null if not specified.

### setObjectIdClass

    public void setObjectIdClass(java.lang.Class cls)

  Set the metadata-specified class to use for the object ID.

### 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 com.solarmetric.rd.kodo.meta.FieldMetaData[] getFields()

  Return all field metadatas, including superclass fields.

### getDeclaredFields

    public com.solarmetric.rd.kodo.meta.FieldMetaData[] getDeclaredFields()

  Return only the fields for this class, without superclass fields.

### getPrimaryKeyFields

    public com.solarmetric.rd.kodo.meta.FieldMetaData[] getPrimaryKeyFields()

  Return primary key fields, or empty array if none.

### getField

    public com.solarmetric.rd.kodo.meta.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 com.solarmetric.rd.kodo.meta.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 com.solarmetric.rd.kodo.meta.FieldMetaData getField(java.lang.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 com.solarmetric.rd.kodo.meta.FieldMetaData getDeclaredField(java.lang.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 com.solarmetric.rd.kodo.meta.FieldMetaData[] getDeclaredUnmanagedFields()

  Return any fields that were added as non-managed. All other methods to get fields return only those that are managed.

### addDeclaredField

    public void addDeclaredField(com.solarmetric.rd.kodo.meta.FieldMetaData field)

  Add a persistent or transactional field to this class.

### removeDeclaredField

    public boolean removeDeclaredField(com.solarmetric.rd.kodo.meta.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`.

### getCanCache

    public boolean getCanCache()

  Return true if the `CAN_CACHE` extension key is true.

### setCanCache

    public void setCanCache(boolean cacheable)

  Set the value of the `CAN_CACHE` standard extension.

### resolve

    public boolean 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 is called automatically through operations that require resolution to complete.

  Returns:
    true if any subclasses should resolve their information too

### invalidateResolve

    public void invalidateResolve()

  For implemntation use. Concrete implementations should call this method when changing something that requires the class to be re-resolved.

Overview | Package | Class | Tree | Deprecated | Index | Help
| SolarMetric Kodo JDO 2.5.0 Reverse Schema Tool
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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