Kodo 4.0.0RC2 generated on May 12 2006

kodo.meta
Class FieldMetaData

java.lang.Object
  extended by Extensions
      extended by kodo.meta.FieldMetaData

public class FieldMetaData
extends Extensions

Metadata for a managed class field.


Field Summary
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 int NULL_UNSET
          Constant specifying that no null-value was given.
 
Constructor Summary
protected FieldMetaData(String name, Class type, ClassMetaData owner)
          Constructor.
 
Method Summary
 ClassMetaData addEmbeddedMetaData()
           
protected  void addExtensionKeys(Collection exts)
           
 void backingMember(Member member)
          Supply the backing member object; this allows us to utilize parameterized type information if available.
 int compareTo(Object other)
           
 void copy(FieldMetaData field)
          Copy state from the given field to this one.
 boolean equals(Object other)
           
 Member getBackingMember()
          Return the backing member supplied in backingMember(java.lang.reflect.Member).
 int getCascadeAttach()
           
 int getCascadeDelete()
           
 int getCascadePersist()
           
 int getCascadeRefresh()
           
 String[] getComments()
           
 int getDeclaredIndex()
          The relative index of this persistent/transactional field.
 Class getDeclaredType()
           
 int getDeclaredTypeCode()
           
 ClassMetaData getDeclaredTypeMetaData()
           
 ClassMetaData getDeclaringMetaData()
          The declaring class.
 Class getDeclaringType()
          The declaring class.
 ClassMetaData getDefiningMetaData()
          The class that defines the metadata for this field.
 ValueMetaData getElement()
          Metadata about the element value.
 ClassMetaData getEmbeddedMetaData()
           
 String getExternalizer()
          The name of this field's externalizer, or null if none.
 Method getExternalizerMethod()
          The externalizer method.
 Object getExternalValue(Object val, StoreContext ctx)
          Convert the given field value to its external value through the provided externalizer, or return the value as-is if no externalizer.
 Map getExternalValueMap()
          Return the mapping of field values to external values.
 String getExternalValues()
          Properties string mapping field values to external values.
 String getFactory()
          The name of this field's factory, or null if none.
 Member getFactoryMethod()
          The factory method or constructor.
 String getFetchGroup()
          Return the name of the custom fetch group for this field, or null if none.
 FieldMetaData getFieldMetaData()
           
 Object getFieldValue(Object val, StoreContext ctx)
          Return the result of passing the given external value through the factory to get the field value.
 Map getFieldValueMap()
          Return the mapping of external values to field values.
 String getFullName()
          The field name, qualified by the owning class.
 int getIndex()
          The absolute index of this persistent/transactional field.
 Object getInitializer()
          The initializer used by the field, or null if none.
 String getInverse()
          Logical inverse field.
 FieldMetaData[] getInverseMetaDatas()
          Return all inverses of this field.
 ValueMetaData getKey()
          Metadata about the key value.
 int getListingIndex()
          The index in which this field was listed in the metadata.
 LockGroup getLockGroup()
          The lock group for this field, or null if none.
 int getManagement()
          Return the management level for the field.
 String getMappedBy()
          The field that this field shares a mapping with.
 FieldMetaData getMappedByMetaData()
          The field that this field shares a mapping with.
 String getName()
          The field name.
 int getNullValue()
          How the data store should treat null values for this field: NULL_UNSET: no value supplied 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_UNSET.
 String getOrderDeclaration()
          String declaring the orderings for this field to be applied on load, or null.
 Order[] getOrders()
          The orderings for this field to be applied on load, or empty array.
 int getPrimaryKeyIndex()
          The absolute primary key index for this field, or -1 if not a primary key.
 Class getProxyType()
          The type this field was initialized with, and therefore the type to use for proxies when loading data into this field.
 MetaDataRepository getRepository()
          The metadata repository.
 int getResolve()
          Resolve mode for this field.
 Class getType()
           
 int getTypeCode()
           
 ClassMetaData getTypeMetaData()
           
 Class getTypeOverride()
           
 int getUpdateStrategy()
          The strategy to use when updating the field.
 ValueMetaData getValue()
          MetaData about the field value.
 String getValueMappedBy()
           
 FieldMetaData getValueMappedByMetaData()
           
 SequenceMetaData getValueSequenceMetaData()
          Metadata for the value sequence.
 String getValueSequenceName()
          The value sequence name, or null for none.
 int getValueStrategy()
          The strategy to use for insert value generation.
 int hashCode()
           
 boolean isDeclaredTypePC()
           
 boolean isDefaultFetchGroupExplicit()
          Whether the default fetch group setting is explicit.
 boolean isEmbedded()
           
 boolean isEmbeddedPC()
           
 boolean isExplicit()
          Whether this field is explicitly declared in the metadata.
 boolean isExternalized()
          Whether the field is externalized.
 boolean isInDefaultFetchGroup()
          Whether this field is in the default fetch group.
 boolean isLRS()
          Whether this field is backed by a large result set.
 boolean isMapped()
          Return whether this field is mapped to the datastore.
 boolean isPrimaryKey()
          Whether this is a primary key field.
 boolean isSerialized()
           
 boolean isTransient()
          Return whether this is a transient field.
 boolean isTypePC()
           
 boolean isVersion()
          Whether this field holds optimistic version information.
 Object order(Object val)
          Order this field value when it is loaded.
 boolean resolve(int mode)
          Resolve and validate metadata.
 void setCascadeAttach(int attach)
           
 void setCascadeDelete(int delete)
           
 void setCascadePersist(int persist)
           
 void setCascadeRefresh(int refresh)
           
 void setComments(String[] comments)
           
 void setDeclaredIndex(int index)
          The relative index of this persistent/transactional field.
 void setDeclaredType(Class type)
           
 void setDeclaredTypeCode(int type)
           
 void setDeclaringType(Class cls)
          The declaring class.
 void setDefaultFetchGroupExplicit(boolean explicit)
          Whether the default fetch group setting is explicit.
 void setEmbedded(boolean embedded)
           
 void setExplicit(boolean explicit)
          Whether this field is explicitly declared in the metadata.
 void setExternalizer(String externalizer)
          The name of this field's externalizer, or null if none.
 void setExternalValues(String values)
          Properties string mapping field values to external values.
 void setFactory(String factory)
          The name of this field's factory, or null if none.
 void setFetchGroup(String fg)
          Return the name of the custom fetch group for this field, or null if none.
 void setInDefaultFetchGroup(boolean dfg)
          Whether this field is in the default fetch group.
 void setIndex(int index)
          The absolute index of this persistent/transactional field.
 void setInitializer(Object initializer)
          The initializer used by the field, or null if none.
 void setInverse(String inverse)
          Logical inverse field.
 void setListingIndex(int index)
          The index in which this field was listed in the metadata.
 void setLockGroup(LockGroup lg)
          The lock group for this field, or null if none.
 void setLRS(boolean lrs)
          Whether this field is backed by a large result set.
 void setManagement(int manage)
          Return the management level for the field.
 void setMappedBy(String mapped)
          The field that this field shares a mapping with.
 void setNullValue(int nullValue)
          How the data store should treat null values for this field: NULL_UNSET: no value supplied 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_UNSET.
 void setOrderDeclaration(String dec)
          String declaring the orderings for this field to be applied on load, or null.
 void setOrders(Order[] orders)
          The orderings for this field to be applied on load.
 void setPrimaryKey(boolean primKey)
          Whether this is a primary key field.
 void setPrimaryKeyIndex(int index)
          The absolute primary key index for this field, or -1 if not a primary key.
 void setProxyType(Class type)
          The type this field was initialized with, and therefore the type to use for proxies when loading data into this field.
 void setResolve(int mode)
          Resolve mode for this field.
 void setResolve(int mode, boolean on)
          Resolve mode for this field.
 void setSerialized(boolean serialized)
           
 void setTransient(boolean trans)
          Return whether this is a transient field.
 void setType(Class type)
           
 void setTypeCode(int code)
           
 void setTypeOverride(Class type)
           
 void setUpdateStrategy(int strategy)
          Set the update strategy.
 void setUsesImplData(Boolean implData)
          Whether this field uses impl data in conjunction with standard field data when acting on a KodoStateManager.
 void setUsesIntermediate(boolean intermediate)
          Whether this field uses intermediate data when loading/storing information through a KodoStateManager.
 void setValueMappedBy(String mapped)
           
 void setValueSequenceName(String seqName)
          The value sequence name, or null for none.
 void setValueStrategy(int strategy)
          The strategy to use for insert value generation.
 void setVersion(boolean version)
          Whether this field holds optimistic version information.
 String toString()
           
 Boolean usesImplData()
          Whether this field uses impl data in conjunction with standard field data when acting on a KodoStateManager.
 boolean usesIntermediate()
          Whether this field uses intermediate data when loading/storing information through a KodoStateManager.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

NULL_UNSET

public static final int NULL_UNSET
Constant specifying that no null-value was given.

See Also:
Constant Field Values

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

FieldMetaData

protected FieldMetaData(String name,
                        Class type,
                        ClassMetaData owner)
Constructor.

Parameters:
name - the field name
type - the field type
owner - the owning class metadata
Method Detail

backingMember

public void backingMember(Member member)
Supply the backing member object; this allows us to utilize parameterized type information if available.


getBackingMember

public Member getBackingMember()
Return the backing member supplied in backingMember(java.lang.reflect.Member).


getRepository

public MetaDataRepository getRepository()
The metadata repository.


getDefiningMetaData

public ClassMetaData getDefiningMetaData()
The class that defines the metadata for this field.


getDeclaringType

public Class getDeclaringType()
The declaring class.


setDeclaringType

public void setDeclaringType(Class cls)
The declaring class.


getDeclaringMetaData

public ClassMetaData getDeclaringMetaData()
The declaring class.


getName

public String getName()
The field name.


getFullName

public String getFullName()
The field name, qualified by the owning class.


getValue

public ValueMetaData getValue()
MetaData about the field value.


getKey

public ValueMetaData getKey()
Metadata about the key value.


getElement

public ValueMetaData getElement()
Metadata about the element value.


isMapped

public boolean isMapped()
Return whether this field is mapped to the datastore. By default, returns true for all persistent fields whose defining class is mapped.


getProxyType

public Class getProxyType()
The type this field was initialized with, and therefore the type to use for proxies when loading data into this field.


setProxyType

public void setProxyType(Class type)
The type this field was initialized with, and therefore the type to use for proxies when loading data into this field.


getInitializer

public Object getInitializer()
The initializer used by the field, or null if none. This is additional information for initializing the field, such as a custom Comparator used by a Set or a TimeZone used by a Calendar.


setInitializer

public void setInitializer(Object initializer)
The initializer used by the field, or null if none. This is additional information for initializing the field, such as a custom Comparator used by a Set or a TimeZone used by a Calendar.


isTransient

public boolean isTransient()
Return whether this is a transient field.


setTransient

public void setTransient(boolean trans)
Return whether this is a transient field.


getIndex

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


setIndex

public void setIndex(int index)
The absolute index of this persistent/transactional field.


getDeclaredIndex

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


setDeclaredIndex

public void setDeclaredIndex(int index)
The relative index of this persistent/transactional field.


getListingIndex

public int getListingIndex()
The index in which this field was listed in the metadata. Defaults to -1 if this field was not listed in the metadata.


setListingIndex

public void setListingIndex(int index)
The index in which this field was listed in the metadata. Defaults to -1 if this field was not listed in the metadata.


getPrimaryKeyIndex

public int getPrimaryKeyIndex()
The absolute primary key index for this field, or -1 if not a primary key. The first primary key field has index 0, the second index 1, etc.


setPrimaryKeyIndex

public void setPrimaryKeyIndex(int index)
The absolute primary key index for this field, or -1 if not a primary key. The first primary key field has index 0, the second index 1, etc.


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)
Return the management level for the field. Will be one of: Defaults to MANAGE_PERSISTENT.


isPrimaryKey

public boolean isPrimaryKey()
Whether this is a primary key field.


setPrimaryKey

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


isVersion

public boolean isVersion()
Whether this field holds optimistic version information.


setVersion

public void setVersion(boolean version)
Whether this field holds optimistic version information.


isInDefaultFetchGroup

public boolean isInDefaultFetchGroup()
Whether this field is in the default fetch group.


setInDefaultFetchGroup

public void setInDefaultFetchGroup(boolean dfg)
Whether this field is in the default fetch group.


isDefaultFetchGroupExplicit

public boolean isDefaultFetchGroupExplicit()
Whether the default fetch group setting is explicit.


setDefaultFetchGroupExplicit

public void setDefaultFetchGroupExplicit(boolean explicit)
Whether the default fetch group setting is explicit. Allow setting for testing.


getNullValue

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


setNullValue

public void setNullValue(int nullValue)
How the data store should treat null values for this field: Defaults to NULL_UNSET.


isExplicit

public boolean isExplicit()
Whether this field is explicitly declared in the metadata.


setExplicit

public void setExplicit(boolean explicit)
Whether this field is explicitly declared in the metadata.


getMappedBy

public String getMappedBy()
The field that this field shares a mapping with.


setMappedBy

public void setMappedBy(String mapped)
The field that this field shares a mapping with.


getMappedByMetaData

public FieldMetaData getMappedByMetaData()
The field that this field shares a mapping with.


getInverse

public String getInverse()
Logical inverse field.


setInverse

public void setInverse(String inverse)
Logical inverse field.


getInverseMetaDatas

public FieldMetaData[] getInverseMetaDatas()
Return all inverses of this field.


getValueStrategy

public int getValueStrategy()
The strategy to use for insert value generation. One of the constants from ValueStrategies.


setValueStrategy

public void setValueStrategy(int strategy)
The strategy to use for insert value generation. One of the constants from ValueStrategies.


getValueSequenceName

public String getValueSequenceName()
The value sequence name, or null for none.


setValueSequenceName

public void setValueSequenceName(String seqName)
The value sequence name, or null for none.


getValueSequenceMetaData

public SequenceMetaData getValueSequenceMetaData()
Metadata for the value sequence.


getUpdateStrategy

public int getUpdateStrategy()
The strategy to use when updating the field.


setUpdateStrategy

public void setUpdateStrategy(int strategy)
Set the update strategy.


isLRS

public boolean isLRS()
Whether this field is backed by a large result set.


setLRS

public void setLRS(boolean lrs)
Whether this field is backed by a large result set.


getFetchGroup

public String getFetchGroup()
Return the name of the custom fetch group for this field, or null if none.


setFetchGroup

public void setFetchGroup(String fg)
Return the name of the custom fetch group for this field, or null if none.


usesIntermediate

public boolean usesIntermediate()
Whether this field uses intermediate data when loading/storing information through a KodoStateManager. Defaults to true.

See Also:
KodoStateManager#setIntermediate(int,Object)

setUsesIntermediate

public void setUsesIntermediate(boolean intermediate)
Whether this field uses intermediate data when loading/storing information through a KodoStateManager. Defaults to true.

See Also:
KodoStateManager#setIntermediate(int,Object)

usesImplData

public Boolean usesImplData()
Whether this field uses impl data in conjunction with standard field data when acting on a KodoStateManager. Defaults to Boolean.TRUE (non-cachable impl data).

Returns:
Boolean.FALSE if this field does not use impl data, Boolean.TRUE if this field uses non-cachable impl data, or null if this field uses impl data that should be cached across instances
See Also:
KodoStateManager#setImplData(int,Object)

setUsesImplData

public void setUsesImplData(Boolean implData)
Whether this field uses impl data in conjunction with standard field data when acting on a KodoStateManager.

See Also:
KodoStateManager#setImplData(int,Object), usesImplData()

getLockGroup

public LockGroup getLockGroup()
The lock group for this field, or null if none.


setLockGroup

public void setLockGroup(LockGroup lg)
The lock group for this field, or null if none.


getOrders

public Order[] getOrders()
The orderings for this field to be applied on load, or empty array.


setOrders

public void setOrders(Order[] orders)
The orderings for this field to be applied on load.


getOrderDeclaration

public String getOrderDeclaration()
String declaring the orderings for this field to be applied on load, or null. The string is of the form:
orderable[ asc|desc][, ...]
The orderable #element is used to denote the value of the field's elements.


setOrderDeclaration

public void setOrderDeclaration(String dec)
String declaring the orderings for this field to be applied on load, or null. The string is of the form:
orderable[ asc|desc][, ...]
The orderable #element is used to denote the value of the field's elements.


order

public Object order(Object val)
Order this field value when it is loaded.


isExternalized

public boolean isExternalized()
Whether the field is externalized.


getExternalValue

public Object getExternalValue(Object val,
                               StoreContext ctx)
Convert the given field value to its external value through the provided externalizer, or return the value as-is if no externalizer.


getFieldValue

public Object getFieldValue(Object val,
                            StoreContext ctx)
Return the result of passing the given external value through the factory to get the field value. If no factory is present, the given value is returned as-is.


getExternalizer

public String getExternalizer()
The name of this field's externalizer, or null if none.


setExternalizer

public void setExternalizer(String externalizer)
The name of this field's externalizer, or null if none.


getFactory

public String getFactory()
The name of this field's factory, or null if none.


setFactory

public void setFactory(String factory)
The name of this field's factory, or null if none.


getExternalValues

public String getExternalValues()
Properties string mapping field values to external values.


setExternalValues

public void setExternalValues(String values)
Properties string mapping field values to external values.


getExternalValueMap

public Map getExternalValueMap()
Return the mapping of field values to external values.


getFieldValueMap

public Map getFieldValueMap()
Return the mapping of external values to field values.


getExternalizerMethod

public Method getExternalizerMethod()
The externalizer method.


getFactoryMethod

public Member getFactoryMethod()
The factory method or constructor.


hashCode

public int hashCode()

equals

public boolean equals(Object other)

compareTo

public int compareTo(Object other)

toString

public String toString()

getResolve

public int getResolve()
Resolve mode for this field.


setResolve

public void setResolve(int mode)
Resolve mode for this field.


setResolve

public void setResolve(int mode,
                       boolean on)
Resolve mode for this field.


resolve

public boolean resolve(int mode)
Resolve and validate metadata. Return true if already resolved.


copy

public void copy(FieldMetaData field)
Copy state from the given field to this one. Do not copy mapping information.


addExtensionKeys

protected void addExtensionKeys(Collection exts)

getComments

public String[] getComments()

setComments

public void setComments(String[] comments)

getFieldMetaData

public FieldMetaData getFieldMetaData()

getType

public Class getType()

setType

public void setType(Class type)

getTypeCode

public int getTypeCode()

setTypeCode

public void setTypeCode(int code)

isTypePC

public boolean isTypePC()

getTypeMetaData

public ClassMetaData getTypeMetaData()

getDeclaredType

public Class getDeclaredType()

setDeclaredType

public void setDeclaredType(Class type)

getDeclaredTypeCode

public int getDeclaredTypeCode()

setDeclaredTypeCode

public void setDeclaredTypeCode(int type)

isDeclaredTypePC

public boolean isDeclaredTypePC()

getDeclaredTypeMetaData

public ClassMetaData getDeclaredTypeMetaData()

isEmbedded

public boolean isEmbedded()

setEmbedded

public void setEmbedded(boolean embedded)

isEmbeddedPC

public boolean isEmbeddedPC()

getEmbeddedMetaData

public ClassMetaData getEmbeddedMetaData()

addEmbeddedMetaData

public ClassMetaData addEmbeddedMetaData()

getCascadeDelete

public int getCascadeDelete()

setCascadeDelete

public void setCascadeDelete(int delete)

getCascadePersist

public int getCascadePersist()

setCascadePersist

public void setCascadePersist(int persist)

getCascadeAttach

public int getCascadeAttach()

setCascadeAttach

public void setCascadeAttach(int attach)

getCascadeRefresh

public int getCascadeRefresh()

setCascadeRefresh

public void setCascadeRefresh(int refresh)

isSerialized

public boolean isSerialized()

setSerialized

public void setSerialized(boolean serialized)

getValueMappedBy

public String getValueMappedBy()

setValueMappedBy

public void setValueMappedBy(String mapped)

getValueMappedByMetaData

public FieldMetaData getValueMappedByMetaData()

getTypeOverride

public Class getTypeOverride()

setTypeOverride

public void setTypeOverride(Class type)

Kodo 4.0.0RC2 generated on May 12 2006

Copyright 2001-2006 BEA Systems, Inc. All Rights Reserved.