SolarMetric Kodo JDO 2.5.0 Reverse Schema Tool

com.solarmetric.rd.kodo.meta
Interface FieldMetaData

All Superinterfaces:
java.lang.Comparable, Extensions
All Known Implementing Classes:
FieldMapping, FieldMetaDataImpl

public interface FieldMetaData
extends Extensions, java.lang.Comparable

Holds metadata on a particular field.

Field metadata can be created without attaching it to class metadata, or without attaching its class metadata to a repository. However, methods that would require access to metadata for related classes will throw an exception. Also, the field type code may incorrectly remain TYPE_OBJECT when the type of the field is actually persistent (without access to other metadata, there is no way to tell).


Field Summary
static java.lang.String DEPENDENT
          Extension key used to mark first class object fields that should be deleted when the owning object is deleted.
static java.lang.String ELEMENT_DEPENDENT
          Extension key used to mark first class object elements that should be deleted when the owning object is deleted.
static java.lang.String ELEMENT_PC_CLASS
          Extension key used to indicate the general type of elements held by a collection field declared to be of a generic interface or object type.
static java.lang.String INVERSE_OWNER
          Extension key used to mark the opposite side of a bi-directional relationship if the opposite side is the one managing data storage for the relationship.
static java.lang.String KEY_DEPENDENT
          Extension key used to mark first class object keys that should be deleted when the owning object is deleted.
static java.lang.String KEY_PC_CLASS
          Extension key used to indicate the general type of keys held by a map field declared to be of a generic interface or object type.
static int MANAGE_NONE
          Constant specifying the management level of a field.
static int MANAGE_PERSISTENT
          Constant specifying the management level of a field.
static int MANAGE_TRANSACTIONAL
          Constant specifying the management level of a field.
static int NULL_DEFAULT
          Constant specifying to use a datastore default value to persist null values in object fields.
static int NULL_EXCEPTION
          Constant specifying to throw an exception when attempting to persist null values in object fields.
static int NULL_NONE
          Constant specifying to use a datastore null to persist null values in object fields.
static java.lang.String PC_CLASS
          Extension key used to indicate the general type of values held by a field declared to be of a generic interface or object type.
static int TYPE_ARRAY
           
static int TYPE_BIGDECIMAL
           
static int TYPE_BIGINTEGER
           
static int TYPE_BOOLEAN
           
static int TYPE_BOOLEAN_OBJ
           
static int TYPE_BYTE
           
static int TYPE_BYTE_OBJ
           
static int TYPE_CHAR
           
static int TYPE_CHAR_OBJ
           
static int TYPE_COLLECTION
           
static int TYPE_DATE
           
static int TYPE_DOUBLE
           
static int TYPE_DOUBLE_OBJ
           
static int TYPE_FCO
           
static int TYPE_FLOAT
           
static int TYPE_FLOAT_OBJ
           
static int TYPE_INT
           
static int TYPE_INT_OBJ
           
static int TYPE_LOCALE
           
static int TYPE_LONG
           
static int TYPE_LONG_OBJ
           
static int TYPE_MAP
           
static int TYPE_NUMBER
           
static int TYPE_OBJECT
           
static int TYPE_PC_OBJECT
           
static int TYPE_SHORT
           
static int TYPE_SHORT_OBJ
           
static int TYPE_STRING
           
static java.lang.String VALUE_DEPENDENT
          Extension key used to mark first class object values that should be deleted when the owning object is deleted.
static java.lang.String VALUE_PC_CLASS
          Extension key used to indicate the general type of values held by a map field declared to be of a generic interface or object type.
 
Method Summary
 java.lang.Class getDeclaredElementType()
          Return the declared class of the described field.
 int getDeclaredIndex()
          Return the relative index of this persistent/transactional field.
 java.lang.Class getDeclaredKeyType()
          Return the declared class of the described field.
 java.lang.Class getDeclaredType()
          Return the declared class of the described field.
 java.lang.String getElementPCClass()
          The value of the ELEMENT_PC_CLASS extension key.
 java.lang.Class getElementType()
          Return the type of objects stored in the array/collection/map; defaults to Object if not specified, or null if this field does not represent an array/collection/map type.
 int getElementTypeCode()
          Return the type code of objects stored in the array/collection/map, or -1 if not an array/collection/map.
 com.solarmetric.rd.kodo.meta.ClassMetaData getElementTypeMetaData()
          Return metadata for the element type, or null if not persistent.
 byte getFieldFlag()
          Returns the JDO flag type for this field.
 java.lang.String getFullName()
          Return the full name of the described field, in the form <class>.<field>.
 int getIndex()
          Return the absolute index of this persistent/transactional field.
 java.lang.String getInverseOwner()
          Return the field marked as an inverse via the INVERSE_OWNER extension key.
 com.solarmetric.rd.kodo.meta.FieldMetaData getInverseOwnerMetaData()
          Return the metadata for the field's inverse.
 java.lang.String getKeyPCClass()
          The value of the KEY_PC_CLASS extension key.
 java.lang.Class getKeyType()
          The type of objects used as keys in the map; defaults to Object if not specified, or null if this field is not a map.
 int getKeyTypeCode()
          The type code of objects used as keys in the map.
 com.solarmetric.rd.kodo.meta.ClassMetaData getKeyTypeMetaData()
          Return metadata for the key type, or null if not persistent.
 int getManagement()
          Return the management level for the field.
 java.lang.String getName()
          Return the name of the described field.
 int getNullValue()
          How the data store should treat null values for this field: NULL_NONE: leave null values as null in the data store NULL_EXCEPTION: throw an exception if this field is null at commit NULL_DEFAULT: use the database default if this field is null at commit Defaults to NULL_NONE.
 com.solarmetric.rd.kodo.meta.ClassMetaData getOwner()
          Return the owning metadata for this field.
 java.lang.String getPCClass()
          The value of the PC_CLASS extension key.
 java.lang.Class getType()
          Return the class of the described field.
 int getTypeCode()
          Return the type code of the described field.
 com.solarmetric.rd.kodo.meta.ClassMetaData getTypeMetaData()
          Return metadata for the field's type, if the type is persistent.
 void invalidateResolve()
          For implemntation use.
 boolean isDependent()
          Return true if the DEPENDENT extension key is true and the field is a first class object.
 boolean isElementDependent()
          Return true if the ELEMENT_DEPENDENT/VALUE_DEPENDENT extension key is true and the element/value contains first class objects.
 boolean isEmbedded()
          This attribute is a hint to the JDO implementation to store this field in the same instance as the class, rather than as a separate datastore instance.
 boolean isEmbeddedElement()
          A hint to the JDO implementation on whether the arary/collection/map values should be stored as part of the instance rather than as their own instances in the data store.
 boolean isEmbeddedKey()
          A hint to the JDO implementation on whether the map keys should be stored as part of the instance rather than as their own instances in the data store.
 boolean isExplicit()
          Return true if the field is explicitly declared in the metadata.
 boolean isInDefaultFetchGroup()
          Return true if the field should be fetched at once along with all other default fetch group fields, rather than individually.
 boolean isKeyDependent()
          Return true if the KEY_DEPENDENT extension key is true and the key contains first class objects.
 boolean isPrimaryKey()
          If true, the field was specified in the meta data to be a primary key field.
 void resolve()
          For implementation use.
 void setDeclaredIndex(int index)
          Used by ClassMetaData to set index.
 void setDependent(boolean cascade)
          Set the value of the DEPENDENT standard extension.
 void setElementDependent(boolean cascade)
          Set the value of the ELEMENT_DEPENDENT extension key.
 void setElementPCClass(java.lang.String pc)
          The value of the ELEMENT_PC_CLASS extension key.
 void setElementType(java.lang.Class cls)
          Set the element class for this array/collection/map field.
 void setEmbedded(boolean embedded)
          Set the embedded value for the field.
 void setEmbeddedElement(boolean embedded)
          Set whether the elements should be embedded.
 void setEmbeddedKey(boolean embedded)
          Set whether the keys are embedded.
 void setExplicit(boolean explicit)
          Set whether the field was explicitly declared in the metadata.
 void setInDefaultFetchGroup(boolean dfg)
          Set whether the field is in the default fetch group.
 void setIndex(int index)
          Used by ClassMetaData to set index.
 void setInverseOwner(java.lang.String inverse)
          Set the field marked as an inverse via the INVERSE_OWNER extension key.
 void setKeyDependent(boolean cascade)
          Set the value of the KEY_DEPENDENT extension key.
 void setKeyPCClass(java.lang.String pc)
          The value of the KEY_PC_CLASS extension key.
 void setKeyType(java.lang.Class cls)
          Set the key type for this map field.
 void setManagement(int manage)
          Set the management level for the field.
 void setName(java.lang.String name)
          Set the name of the described field.
 void setNullValue(int nullValue)
          Set the null action for the field.
 void setOwner(com.solarmetric.rd.kodo.meta.ClassMetaData owner)
          Set the owning metadata for this field.
 void setPCClass(java.lang.String pc)
          The value of the PC_CLASS extension key.
 void setPrimaryKey(boolean primKey)
          Set whether this is a primary key field.
 void setType(java.lang.Class type)
          Set the class of the described field.
 
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

NULL_NONE

public static final int NULL_NONE
Constant specifying to use a datastore null to persist null values in object fields.

See Also:
Constant Field Values

NULL_DEFAULT

public static final int NULL_DEFAULT
Constant specifying to use a datastore default value to persist null values in object fields.

See Also:
Constant Field Values

NULL_EXCEPTION

public static final int NULL_EXCEPTION
Constant specifying to throw an exception when attempting to persist null values in object fields.

See Also:
Constant Field Values

MANAGE_PERSISTENT

public static final int MANAGE_PERSISTENT
Constant specifying the management level of a field.

See Also:
Constant Field Values

MANAGE_TRANSACTIONAL

public static final int MANAGE_TRANSACTIONAL
Constant specifying the management level of a field.

See Also:
Constant Field Values

MANAGE_NONE

public static final int MANAGE_NONE
Constant specifying the management level of a field.

See Also:
Constant Field Values

DEPENDENT

public static final java.lang.String DEPENDENT
Extension key used to mark first class object fields that should be deleted when the owning object is deleted.

See Also:
Constant Field Values

ELEMENT_DEPENDENT

public static final java.lang.String ELEMENT_DEPENDENT
Extension key used to mark first class object elements that should be deleted when the owning object is deleted.

See Also:
Constant Field Values

KEY_DEPENDENT

public static final java.lang.String KEY_DEPENDENT
Extension key used to mark first class object keys that should be deleted when the owning object is deleted.

See Also:
Constant Field Values

VALUE_DEPENDENT

public static final java.lang.String VALUE_DEPENDENT
Extension key used to mark first class object values that should be deleted when the owning object is deleted.

See Also:
Constant Field Values

INVERSE_OWNER

public static final java.lang.String INVERSE_OWNER
Extension key used to mark the opposite side of a bi-directional relationship if the opposite side is the one managing data storage for the relationship.

See Also:
Constant Field Values

PC_CLASS

public static final java.lang.String PC_CLASS
Extension key used to indicate the general type of values held by a field declared to be of a generic interface or object type. Set this key to true to indicate that the field holds some user-defined persistence-capable value, or to the specific class name of a user-defined persistent type.

See Also:
Constant Field Values

ELEMENT_PC_CLASS

public static final java.lang.String ELEMENT_PC_CLASS
Extension key used to indicate the general type of elements held by a collection field declared to be of a generic interface or object type.

See Also:
PC_CLASS, Constant Field Values

VALUE_PC_CLASS

public static final java.lang.String VALUE_PC_CLASS
Extension key used to indicate the general type of values held by a map field declared to be of a generic interface or object type.

See Also:
PC_CLASS, Constant Field Values

KEY_PC_CLASS

public static final java.lang.String KEY_PC_CLASS
Extension key used to indicate the general type of keys held by a map field declared to be of a generic interface or object type.

See Also:
PC_CLASS, Constant Field Values

TYPE_BOOLEAN

public static final int TYPE_BOOLEAN
See Also:
Constant Field Values

TYPE_BYTE

public static final int TYPE_BYTE
See Also:
Constant Field Values

TYPE_CHAR

public static final int TYPE_CHAR
See Also:
Constant Field Values

TYPE_DOUBLE

public static final int TYPE_DOUBLE
See Also:
Constant Field Values

TYPE_FLOAT

public static final int TYPE_FLOAT
See Also:
Constant Field Values

TYPE_INT

public static final int TYPE_INT
See Also:
Constant Field Values

TYPE_LONG

public static final int TYPE_LONG
See Also:
Constant Field Values

TYPE_NUMBER

public static final int TYPE_NUMBER
See Also:
Constant Field Values

TYPE_SHORT

public static final int TYPE_SHORT
See Also:
Constant Field Values

TYPE_STRING

public static final int TYPE_STRING
See Also:
Constant Field Values

TYPE_OBJECT

public static final int TYPE_OBJECT
See Also:
Constant Field Values

TYPE_ARRAY

public static final int TYPE_ARRAY
See Also:
Constant Field Values

TYPE_COLLECTION

public static final int TYPE_COLLECTION
See Also:
Constant Field Values

TYPE_MAP

public static final int TYPE_MAP
See Also:
Constant Field Values

TYPE_DATE

public static final int TYPE_DATE
See Also:
Constant Field Values

TYPE_FCO

public static final int TYPE_FCO
See Also:
Constant Field Values

TYPE_BOOLEAN_OBJ

public static final int TYPE_BOOLEAN_OBJ
See Also:
Constant Field Values

TYPE_BYTE_OBJ

public static final int TYPE_BYTE_OBJ
See Also:
Constant Field Values

TYPE_CHAR_OBJ

public static final int TYPE_CHAR_OBJ
See Also:
Constant Field Values

TYPE_DOUBLE_OBJ

public static final int TYPE_DOUBLE_OBJ
See Also:
Constant Field Values

TYPE_FLOAT_OBJ

public static final int TYPE_FLOAT_OBJ
See Also:
Constant Field Values

TYPE_INT_OBJ

public static final int TYPE_INT_OBJ
See Also:
Constant Field Values

TYPE_LONG_OBJ

public static final int TYPE_LONG_OBJ
See Also:
Constant Field Values

TYPE_SHORT_OBJ

public static final int TYPE_SHORT_OBJ
See Also:
Constant Field Values

TYPE_BIGDECIMAL

public static final int TYPE_BIGDECIMAL
See Also:
Constant Field Values

TYPE_BIGINTEGER

public static final int TYPE_BIGINTEGER
See Also:
Constant Field Values

TYPE_LOCALE

public static final int TYPE_LOCALE
See Also:
Constant Field Values

TYPE_PC_OBJECT

public static final int TYPE_PC_OBJECT
See Also:
Constant Field Values
Method Detail

getOwner

public com.solarmetric.rd.kodo.meta.ClassMetaData getOwner()
Return the owning metadata for this field.


setOwner

public void setOwner(com.solarmetric.rd.kodo.meta.ClassMetaData owner)
Set the owning metadata for this field.


getName

public java.lang.String getName()
Return the name of the described field.


setName

public void setName(java.lang.String name)
Set the name of the described field.


getFullName

public java.lang.String getFullName()
Return the full name of the described field, in the form <class>.<field>.


getType

public java.lang.Class getType()
Return the class of the described field.


setType

public void setType(java.lang.Class type)
Set the class of the described field.


getDeclaredType

public java.lang.Class getDeclaredType()
Return the declared class of the described field. This can differ from the return value of getType() if the user indicates a more specific type with the PC_CLASS extension.


getTypeCode

public int getTypeCode()
Return the type code of the described field.


getTypeMetaData

public com.solarmetric.rd.kodo.meta.ClassMetaData getTypeMetaData()
Return metadata for the field's type, if the type is persistent.


getIndex

public int getIndex()
Return the absolute index of this persistent/transactional field.


setIndex

public void setIndex(int index)
Used by ClassMetaData to set index.


getDeclaredIndex

public int getDeclaredIndex()
Return the relative index of this persistent/transactional field.


setDeclaredIndex

public void setDeclaredIndex(int index)
Used by ClassMetaData to set index.


getManagement

public int getManagement()
Return the management level for the field. Will be one of: Defaults to MANAGE_PERSISTENT.


setManagement

public void setManagement(int manage)
Set the management level for the field.

See Also:
getManagement()

isPrimaryKey

public boolean isPrimaryKey()
If true, the field was specified in the meta data to be a primary key field.


setPrimaryKey

public void setPrimaryKey(boolean primKey)
Set whether this is a primary key field.


getFieldFlag

public byte getFieldFlag()
Returns the JDO flag type for this field. See the field types in the PersistenceCapable interface.


getNullValue

public int getNullValue()
How the data store should treat null values for this field: Defaults to NULL_NONE.


setNullValue

public void setNullValue(int nullValue)
Set the null action for the field.

See Also:
getNullValue()

isExplicit

public boolean isExplicit()
Return true if the field is explicitly declared in the metadata.


setExplicit

public void setExplicit(boolean explicit)
Set whether the field was explicitly declared in the metadata.


isInDefaultFetchGroup

public boolean isInDefaultFetchGroup()
Return true if the field should be fetched at once along with all other default fetch group fields, rather than individually. Defaults to true if the field is not a collection or map or array or first class object or unknown object; defaults to false otherwise.


setInDefaultFetchGroup

public void setInDefaultFetchGroup(boolean dfg)
Set whether the field is in the default fetch group.


isEmbedded

public boolean isEmbedded()
This attribute is a hint to the JDO implementation to store this field in the same instance as the class, rather than as a separate datastore instance. Defaults to true if the field is not a collection or map or first class object; defaults to false otherwise. Implementations are permitted to ignore this attribute.


setEmbedded

public void setEmbedded(boolean embedded)
Set the embedded value for the field.


getElementType

public java.lang.Class getElementType()
Return the type of objects stored in the array/collection/map; defaults to Object if not specified, or null if this field does not represent an array/collection/map type.


getDeclaredElementType

public java.lang.Class getDeclaredElementType()
Return the declared class of the described field. This can differ from the return value of getElementType() if the user indicates a more specific type with the ELEMENT_PC_CLASS extension.


getElementTypeCode

public int getElementTypeCode()
Return the type code of objects stored in the array/collection/map, or -1 if not an array/collection/map.


getElementTypeMetaData

public com.solarmetric.rd.kodo.meta.ClassMetaData getElementTypeMetaData()
Return metadata for the element type, or null if not persistent.


setElementType

public void setElementType(java.lang.Class cls)
Set the element class for this array/collection/map field.


isEmbeddedElement

public boolean isEmbeddedElement()
A hint to the JDO implementation on whether the arary/collection/map values should be stored as part of the instance rather than as their own instances in the data store. Implementations are permitted to ignore this attribute.


setEmbeddedElement

public void setEmbeddedElement(boolean embedded)
Set whether the elements should be embedded.


getKeyType

public java.lang.Class getKeyType()
The type of objects used as keys in the map; defaults to Object if not specified, or null if this field is not a map.


getDeclaredKeyType

public java.lang.Class getDeclaredKeyType()
Return the declared class of the described field. This can differ from the return value of getKeyType() if the user indicates a more specific type with the KEY_PC_CLASS extension.


getKeyTypeCode

public int getKeyTypeCode()
The type code of objects used as keys in the map.


getKeyTypeMetaData

public com.solarmetric.rd.kodo.meta.ClassMetaData getKeyTypeMetaData()
Return metadata for the key type, or null if not persistent.


setKeyType

public void setKeyType(java.lang.Class cls)
Set the key type for this map field.


isEmbeddedKey

public boolean isEmbeddedKey()
A hint to the JDO implementation on whether the map keys should be stored as part of the instance rather than as their own instances in the data store. Implementations are permitted to ignore this attribute.


setEmbeddedKey

public void setEmbeddedKey(boolean embedded)
Set whether the keys are embedded.


getInverseOwner

public java.lang.String getInverseOwner()
Return the field marked as an inverse via the INVERSE_OWNER extension key.


setInverseOwner

public void setInverseOwner(java.lang.String inverse)
Set the field marked as an inverse via the INVERSE_OWNER extension key.


getInverseOwnerMetaData

public com.solarmetric.rd.kodo.meta.FieldMetaData getInverseOwnerMetaData()
Return the metadata for the field's inverse.


isDependent

public boolean isDependent()
Return true if the DEPENDENT extension key is true and the field is a first class object.


setDependent

public void setDependent(boolean cascade)
Set the value of the DEPENDENT standard extension.


isElementDependent

public boolean isElementDependent()
Return true if the ELEMENT_DEPENDENT/VALUE_DEPENDENT extension key is true and the element/value contains first class objects.


setElementDependent

public void setElementDependent(boolean cascade)
Set the value of the ELEMENT_DEPENDENT extension key.


isKeyDependent

public boolean isKeyDependent()
Return true if the KEY_DEPENDENT extension key is true and the key contains first class objects.


setKeyDependent

public void setKeyDependent(boolean cascade)
Set the value of the KEY_DEPENDENT extension key.


getPCClass

public java.lang.String getPCClass()
The value of the PC_CLASS extension key.


setPCClass

public void setPCClass(java.lang.String pc)
The value of the PC_CLASS extension key.


getElementPCClass

public java.lang.String getElementPCClass()
The value of the ELEMENT_PC_CLASS extension key.


setElementPCClass

public void setElementPCClass(java.lang.String pc)
The value of the ELEMENT_PC_CLASS extension key.


getKeyPCClass

public java.lang.String getKeyPCClass()
The value of the KEY_PC_CLASS extension key.


setKeyPCClass

public void setKeyPCClass(java.lang.String pc)
The value of the KEY_PC_CLASS extension key.


resolve

public void resolve()
For implementation use. This method resolves fields that might be other first class objects. It requires access to a respository. It is called automatically when the owning class metadata is resolved.


invalidateResolve

public void invalidateResolve()
For implemntation use. Concrete implementations should call this method when changing something that requires the field to be re-resolved.


SolarMetric Kodo JDO 2.5.0 Reverse Schema Tool

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