SolarMetric Kodo JDO 2.5.0 Reverse Schema Tool

com.solarmetric.rd.kodo.meta
Class FieldMetaDataImpl

java.lang.Object
  |
  +--com.solarmetric.rd.kodo.meta.ExtensionsImpl
        |
        +--com.solarmetric.rd.kodo.meta.FieldMetaDataImpl
All Implemented Interfaces:
java.lang.Comparable, Extensions, FieldMetaData

public class FieldMetaDataImpl
extends ExtensionsImpl
implements FieldMetaData

Default FieldMetaData implementation.


Field Summary
 
Fields inherited from interface com.solarmetric.rd.kodo.meta.FieldMetaData
DEPENDENT, ELEMENT_DEPENDENT, ELEMENT_PC_CLASS, INVERSE_OWNER, KEY_DEPENDENT, KEY_PC_CLASS, MANAGE_NONE, MANAGE_PERSISTENT, MANAGE_TRANSACTIONAL, NULL_DEFAULT, NULL_EXCEPTION, NULL_NONE, PC_CLASS, TYPE_ARRAY, TYPE_BIGDECIMAL, TYPE_BIGINTEGER, TYPE_BOOLEAN, TYPE_BOOLEAN_OBJ, TYPE_BYTE, TYPE_BYTE_OBJ, TYPE_CHAR, TYPE_CHAR_OBJ, TYPE_COLLECTION, TYPE_DATE, TYPE_DOUBLE, TYPE_DOUBLE_OBJ, TYPE_FCO, TYPE_FLOAT, TYPE_FLOAT_OBJ, TYPE_INT, TYPE_INT_OBJ, TYPE_LOCALE, TYPE_LONG, TYPE_LONG_OBJ, TYPE_MAP, TYPE_NUMBER, TYPE_OBJECT, TYPE_PC_OBJECT, TYPE_SHORT, TYPE_SHORT_OBJ, TYPE_STRING, VALUE_DEPENDENT, VALUE_PC_CLASS
 
Constructor Summary
FieldMetaDataImpl()
          Default constructor.
FieldMetaDataImpl(java.lang.String name, java.lang.Class type)
          Constructor.
 
Method Summary
protected  com.solarmetric.rd.kodo.meta.JDOMetaDataRepository checkRepository()
           
 int compareTo(java.lang.Object other)
           
 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 FieldMetaData.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 FieldMetaData.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 FieldMetaData.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: FieldMetaData.NULL_NONE: leave null values as null in the data store FieldMetaData.NULL_EXCEPTION: throw an exception if this field is null at commit FieldMetaData.NULL_DEFAULT: use the database default if this field is null at commit Defaults to FieldMetaData.NULL_NONE.
 com.solarmetric.rd.kodo.meta.ClassMetaData getOwner()
          Return the owning metadata for this field.
 java.lang.String getPCClass()
          The value of the FieldMetaData.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.
static int getTypeCode(java.lang.Class type)
          Return the field metadata type code for the given class.
 com.solarmetric.rd.kodo.meta.ClassMetaData getTypeMetaData()
          Return metadata for the field's type, if the type is persistent.
 void invalidateResolve()
          For implemntation use.
static boolean isDefaultPersistent(java.lang.Class type)
          Return true if the given type is considered default persistent by JDO.
 boolean isDependent()
          Return true if the FieldMetaData.DEPENDENT extension key is true and the field is a first class object.
 boolean isElementDependent()
          Return true if the FieldMetaData.ELEMENT_DEPENDENT/FieldMetaData.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 FieldMetaData.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 FieldMetaData.DEPENDENT standard extension.
 void setElementDependent(boolean cascade)
          Set the value of the FieldMetaData.ELEMENT_DEPENDENT extension key.
 void setElementPCClass(java.lang.String val)
          The value of the FieldMetaData.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 FieldMetaData.INVERSE_OWNER extension key.
 void setKeyDependent(boolean cascade)
          Set the value of the FieldMetaData.KEY_DEPENDENT extension key.
 void setKeyPCClass(java.lang.String val)
          The value of the FieldMetaData.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 val)
          The value of the FieldMetaData.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.
 java.lang.String toString()
           
 
Methods inherited from class com.solarmetric.rd.kodo.meta.ExtensionsImpl
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 class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
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
 

Constructor Detail

FieldMetaDataImpl

public FieldMetaDataImpl()
Default constructor.


FieldMetaDataImpl

public FieldMetaDataImpl(java.lang.String name,
                         java.lang.Class type)
Constructor.

Parameters:
name - the field name
type - the field type
Method Detail

isDefaultPersistent

public static boolean isDefaultPersistent(java.lang.Class type)
Return true if the given type is considered default persistent by JDO.


getOwner

public com.solarmetric.rd.kodo.meta.ClassMetaData getOwner()
Description copied from interface: FieldMetaData
Return the owning metadata for this field.

Specified by:
getOwner in interface FieldMetaData

setOwner

public void setOwner(com.solarmetric.rd.kodo.meta.ClassMetaData owner)
Description copied from interface: FieldMetaData
Set the owning metadata for this field.

Specified by:
setOwner in interface FieldMetaData

getName

public java.lang.String getName()
Description copied from interface: FieldMetaData
Return the name of the described field.

Specified by:
getName in interface FieldMetaData

getFullName

public java.lang.String getFullName()
Description copied from interface: FieldMetaData
Return the full name of the described field, in the form <class>.<field>.

Specified by:
getFullName in interface FieldMetaData

setName

public void setName(java.lang.String name)
Description copied from interface: FieldMetaData
Set the name of the described field.

Specified by:
setName in interface FieldMetaData

getType

public java.lang.Class getType()
Description copied from interface: FieldMetaData
Return the class of the described field.

Specified by:
getType in interface FieldMetaData

setType

public void setType(java.lang.Class type)
Description copied from interface: FieldMetaData
Set the class of the described field.

Specified by:
setType in interface FieldMetaData

getDeclaredType

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

Specified by:
getDeclaredType in interface FieldMetaData

getTypeCode

public int getTypeCode()
Description copied from interface: FieldMetaData
Return the type code of the described field.

Specified by:
getTypeCode in interface FieldMetaData

getTypeMetaData

public com.solarmetric.rd.kodo.meta.ClassMetaData getTypeMetaData()
Description copied from interface: FieldMetaData
Return metadata for the field's type, if the type is persistent.

Specified by:
getTypeMetaData in interface FieldMetaData

getIndex

public int getIndex()
Description copied from interface: FieldMetaData
Return the absolute index of this persistent/transactional field.

Specified by:
getIndex in interface FieldMetaData

setIndex

public void setIndex(int index)
Description copied from interface: FieldMetaData
Used by ClassMetaData to set index.

Specified by:
setIndex in interface FieldMetaData

getDeclaredIndex

public int getDeclaredIndex()
Description copied from interface: FieldMetaData
Return the relative index of this persistent/transactional field.

Specified by:
getDeclaredIndex in interface FieldMetaData

setDeclaredIndex

public void setDeclaredIndex(int index)
Description copied from interface: FieldMetaData
Used by ClassMetaData to set index.

Specified by:
setDeclaredIndex in interface FieldMetaData

getManagement

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

Specified by:
getManagement in interface FieldMetaData

setManagement

public void setManagement(int manage)
Description copied from interface: FieldMetaData
Set the management level for the field.

Specified by:
setManagement in interface FieldMetaData
See Also:
FieldMetaData.getManagement()

isPrimaryKey

public boolean isPrimaryKey()
Description copied from interface: FieldMetaData
If true, the field was specified in the meta data to be a primary key field.

Specified by:
isPrimaryKey in interface FieldMetaData

setPrimaryKey

public void setPrimaryKey(boolean primKey)
Description copied from interface: FieldMetaData
Set whether this is a primary key field.

Specified by:
setPrimaryKey in interface FieldMetaData

getFieldFlag

public byte getFieldFlag()
Description copied from interface: FieldMetaData
Returns the JDO flag type for this field. See the field types in the PersistenceCapable interface.

Specified by:
getFieldFlag in interface FieldMetaData

getNullValue

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

Specified by:
getNullValue in interface FieldMetaData

setNullValue

public void setNullValue(int nullValue)
Description copied from interface: FieldMetaData
Set the null action for the field.

Specified by:
setNullValue in interface FieldMetaData
See Also:
FieldMetaData.getNullValue()

isExplicit

public boolean isExplicit()
Description copied from interface: FieldMetaData
Return true if the field is explicitly declared in the metadata.

Specified by:
isExplicit in interface FieldMetaData

setExplicit

public void setExplicit(boolean explicit)
Description copied from interface: FieldMetaData
Set whether the field was explicitly declared in the metadata.

Specified by:
setExplicit in interface FieldMetaData

isInDefaultFetchGroup

public boolean isInDefaultFetchGroup()
Description copied from interface: FieldMetaData
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.

Specified by:
isInDefaultFetchGroup in interface FieldMetaData

setInDefaultFetchGroup

public void setInDefaultFetchGroup(boolean dfg)
Description copied from interface: FieldMetaData
Set whether the field is in the default fetch group.

Specified by:
setInDefaultFetchGroup in interface FieldMetaData

isEmbedded

public boolean isEmbedded()
Description copied from interface: FieldMetaData
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.

Specified by:
isEmbedded in interface FieldMetaData

setEmbedded

public void setEmbedded(boolean embedded)
Description copied from interface: FieldMetaData
Set the embedded value for the field.

Specified by:
setEmbedded in interface FieldMetaData

getElementType

public java.lang.Class getElementType()
Description copied from interface: FieldMetaData
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.

Specified by:
getElementType in interface FieldMetaData

getDeclaredElementType

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

Specified by:
getDeclaredElementType in interface FieldMetaData

getElementTypeCode

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

Specified by:
getElementTypeCode in interface FieldMetaData

getElementTypeMetaData

public com.solarmetric.rd.kodo.meta.ClassMetaData getElementTypeMetaData()
Description copied from interface: FieldMetaData
Return metadata for the element type, or null if not persistent.

Specified by:
getElementTypeMetaData in interface FieldMetaData

setElementType

public void setElementType(java.lang.Class cls)
Description copied from interface: FieldMetaData
Set the element class for this array/collection/map field.

Specified by:
setElementType in interface FieldMetaData

isEmbeddedElement

public boolean isEmbeddedElement()
Description copied from interface: FieldMetaData
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.

Specified by:
isEmbeddedElement in interface FieldMetaData

setEmbeddedElement

public void setEmbeddedElement(boolean embedded)
Description copied from interface: FieldMetaData
Set whether the elements should be embedded.

Specified by:
setEmbeddedElement in interface FieldMetaData

getKeyType

public java.lang.Class getKeyType()
Description copied from interface: FieldMetaData
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.

Specified by:
getKeyType in interface FieldMetaData

getDeclaredKeyType

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

Specified by:
getDeclaredKeyType in interface FieldMetaData

getKeyTypeCode

public int getKeyTypeCode()
Description copied from interface: FieldMetaData
The type code of objects used as keys in the map.

Specified by:
getKeyTypeCode in interface FieldMetaData

getKeyTypeMetaData

public com.solarmetric.rd.kodo.meta.ClassMetaData getKeyTypeMetaData()
Description copied from interface: FieldMetaData
Return metadata for the key type, or null if not persistent.

Specified by:
getKeyTypeMetaData in interface FieldMetaData

setKeyType

public void setKeyType(java.lang.Class cls)
Description copied from interface: FieldMetaData
Set the key type for this map field.

Specified by:
setKeyType in interface FieldMetaData

isEmbeddedKey

public boolean isEmbeddedKey()
Description copied from interface: FieldMetaData
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.

Specified by:
isEmbeddedKey in interface FieldMetaData

setEmbeddedKey

public void setEmbeddedKey(boolean embedded)
Description copied from interface: FieldMetaData
Set whether the keys are embedded.

Specified by:
setEmbeddedKey in interface FieldMetaData

compareTo

public int compareTo(java.lang.Object other)
Specified by:
compareTo in interface java.lang.Comparable

resolve

public void resolve()
Description copied from interface: FieldMetaData
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.

Specified by:
resolve in interface FieldMetaData

getInverseOwner

public java.lang.String getInverseOwner()
Description copied from interface: FieldMetaData
Return the field marked as an inverse via the FieldMetaData.INVERSE_OWNER extension key.

Specified by:
getInverseOwner in interface FieldMetaData

setInverseOwner

public void setInverseOwner(java.lang.String inverse)
Description copied from interface: FieldMetaData
Set the field marked as an inverse via the FieldMetaData.INVERSE_OWNER extension key.

Specified by:
setInverseOwner in interface FieldMetaData

getInverseOwnerMetaData

public com.solarmetric.rd.kodo.meta.FieldMetaData getInverseOwnerMetaData()
Description copied from interface: FieldMetaData
Return the metadata for the field's inverse.

Specified by:
getInverseOwnerMetaData in interface FieldMetaData

isDependent

public boolean isDependent()
Description copied from interface: FieldMetaData
Return true if the FieldMetaData.DEPENDENT extension key is true and the field is a first class object.

Specified by:
isDependent in interface FieldMetaData

setDependent

public void setDependent(boolean cascade)
Description copied from interface: FieldMetaData
Set the value of the FieldMetaData.DEPENDENT standard extension.

Specified by:
setDependent in interface FieldMetaData

isElementDependent

public boolean isElementDependent()
Description copied from interface: FieldMetaData
Return true if the FieldMetaData.ELEMENT_DEPENDENT/FieldMetaData.VALUE_DEPENDENT extension key is true and the element/value contains first class objects.

Specified by:
isElementDependent in interface FieldMetaData

setElementDependent

public void setElementDependent(boolean cascade)
Description copied from interface: FieldMetaData
Set the value of the FieldMetaData.ELEMENT_DEPENDENT extension key.

Specified by:
setElementDependent in interface FieldMetaData

isKeyDependent

public boolean isKeyDependent()
Description copied from interface: FieldMetaData
Return true if the FieldMetaData.KEY_DEPENDENT extension key is true and the key contains first class objects.

Specified by:
isKeyDependent in interface FieldMetaData

setKeyDependent

public void setKeyDependent(boolean cascade)
Description copied from interface: FieldMetaData
Set the value of the FieldMetaData.KEY_DEPENDENT extension key.

Specified by:
setKeyDependent in interface FieldMetaData

getPCClass

public java.lang.String getPCClass()
Description copied from interface: FieldMetaData
The value of the FieldMetaData.PC_CLASS extension key.

Specified by:
getPCClass in interface FieldMetaData

setPCClass

public void setPCClass(java.lang.String val)
Description copied from interface: FieldMetaData
The value of the FieldMetaData.PC_CLASS extension key.

Specified by:
setPCClass in interface FieldMetaData

getElementPCClass

public java.lang.String getElementPCClass()
Description copied from interface: FieldMetaData
The value of the FieldMetaData.ELEMENT_PC_CLASS extension key.

Specified by:
getElementPCClass in interface FieldMetaData

setElementPCClass

public void setElementPCClass(java.lang.String val)
Description copied from interface: FieldMetaData
The value of the FieldMetaData.ELEMENT_PC_CLASS extension key.

Specified by:
setElementPCClass in interface FieldMetaData

getKeyPCClass

public java.lang.String getKeyPCClass()
Description copied from interface: FieldMetaData
The value of the FieldMetaData.KEY_PC_CLASS extension key.

Specified by:
getKeyPCClass in interface FieldMetaData

setKeyPCClass

public void setKeyPCClass(java.lang.String val)
Description copied from interface: FieldMetaData
The value of the FieldMetaData.KEY_PC_CLASS extension key.

Specified by:
setKeyPCClass in interface FieldMetaData

invalidateResolve

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

Specified by:
invalidateResolve in interface FieldMetaData

checkRepository

protected com.solarmetric.rd.kodo.meta.JDOMetaDataRepository checkRepository()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getTypeCode

public static int getTypeCode(java.lang.Class type)
Return the field metadata type code for the given class. First class objects are not recognized in this method.


SolarMetric Kodo JDO 2.5.0 Reverse Schema Tool

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