org.jpox.metadata
Class PropertyMetaData

java.lang.Object
  extended byorg.jpox.metadata.MetaData
      extended byorg.jpox.metadata.ExtendableMetaData
          extended byorg.jpox.metadata.AbstractPropertyMetaData
              extended byorg.jpox.metadata.PropertyMetaData
All Implemented Interfaces:
ColumnMetaDataContainer, java.lang.Comparable, java.io.Serializable

public class PropertyMetaData
extends AbstractPropertyMetaData
implements java.lang.Comparable, ColumnMetaDataContainer

The property element declares mapping between a virtual field of an implemented interface and the corresponding persistent field of a persistence-capable class. The name attribute is required, and declares the name for the property. The naming conventions for JavaBeans property names is used: the property name is the same as the corresponding get method for the property with the get removed and the resulting name lowercased. The field-name attribute is required; it associates a persistent field with the named property.

MetaData Element

The MetaData Element represented here is as follows
 
 
 
 

Version:
$Revision: 1.6 $
See Also:
Serialized Form

Field Summary
protected  java.lang.String fieldName
          Field name.
 
Fields inherited from class org.jpox.metadata.AbstractPropertyMetaData
className, column, columnMetaData, columns, container, DEFAULT_RECURSION_DEPTH, defaultFetchGroup, dependent, elementMetaData, embedded, embeddedMetaData, fieldId, fieldType, foreignKeyMetaData, indexed, indexMetaData, joinMetaData, keyMetaData, loadFetchGroup, mappedBy, modifiers, name, nullValue, orderMetaData, persistenceModifier, primaryKey, recursionDepth, relatedFieldMetaData, relationType, sequence, serialized, table, type, UNDEFINED_RECURSION_DEPTH, uniqueConstraint, uniqueMetaData, valueMetaData, valueStrategy
 
Fields inherited from class org.jpox.metadata.ExtendableMetaData
extensions, JPOX_VENDOR_NAME
 
Fields inherited from class org.jpox.metadata.MetaData
LOCALISER, METADATA_CREATED_STATE, METADATA_INITIALISED_STATE, METADATA_POPULATED_STATE, METADATA_USED_STATE, metaDataState, parent
 
Constructor Summary
PropertyMetaData(MetaData parent, PropertyMetaData fmd)
          Convenience constructor to copy the specification from the passed field.
PropertyMetaData(MetaData parent, java.lang.String name)
          Convenience constructor taking defaults
PropertyMetaData(MetaData parent, java.lang.String name, java.lang.String pk, java.lang.String modifier, java.lang.String defaultFetchGroup, java.lang.String nullValue, java.lang.String embedded, java.lang.String serialized, java.lang.String dependent, java.lang.String mappedBy, java.lang.String column, java.lang.String table, java.lang.String deleteAction, java.lang.String indexed, java.lang.String unique, java.lang.String recursionDepth, java.lang.String loadFetchGroup, java.lang.String valueStrategy, java.lang.String foreignKey, java.lang.String sequence, java.lang.String fieldType, java.lang.String fieldName)
          Constructor.
 
Method Summary
 int compareTo(java.lang.Object o)
          Comparator method.
 java.lang.String getFieldName()
          Accessor for the field name
 java.lang.String toString(java.lang.String prefix, java.lang.String indent)
          Returns a string representation of the object using a prefix This can be used as part of a facility to output a MetaData file.
 
Methods inherited from class org.jpox.metadata.AbstractPropertyMetaData
addColumn, fieldBelongsToClass, getAbsoluteFieldNumber, getAbstractClassMetaData, getArray, getClassName, getClassName, getCollection, getColumn, getColumnMetaData, getContainer, getElementMetaData, getEmbeddedMetaData, getFieldId, getFieldType, getForeignKeyMetaData, getFullFieldName, getIndexMetaData, getJoinMetaData, getKeyMetaData, getLoadFetchGroup, getMap, getMappedBy, getMetaDataManager, getName, getNullValue, getOrderMetaData, getPersistenceModifier, getRecursionDepth, getRelatedFieldMetaData, getRelationType, getSequence, getTable, getType, getTypeName, getUniqueMetaData, getValueMetaData, getValueStrategy, hasArray, hasCollection, hasContainer, hasMap, initialise, isDefaultFetchGroup, isDependent, isEmbedded, isFieldArrayTypePersistenceCapable, isFieldTypePersistenceCapable, isFinal, isJdoField, isPrimaryKey, isSerialized, isStatic, isTransient, mergeORMData, populate, setContainer, setDependent, setElementMetaData, setEmbeddedMetaData, setForeignKeyMetaData, setIndexMetaData, setJoinMetaData, setKeyMetaData, setMappedBy, setOrderMetaData, setRelation, setSequence, setTable, setUniqueMetaData, setValueMetaData, setValueStrategy, toString
 
Methods inherited from class org.jpox.metadata.ExtendableMetaData
addExtension, addExtension, getExtension, getExtensions, getNoOfExtensions, getValueForExtension, getValuesForExtension, getValuesForExtensionStartingWith, hasExtension, removeExtension
 
Methods inherited from class org.jpox.metadata.MetaData
getParent, isCreated, isInitialised, isPopulated, isUsed, populate, setInitialised, setPopulated, setUsed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jpox.metadata.ColumnMetaDataContainer
addColumn, getColumnMetaData
 

Field Detail

fieldName

protected final java.lang.String fieldName
Field name.

Constructor Detail

PropertyMetaData

public PropertyMetaData(MetaData parent,
                        java.lang.String name)
Convenience constructor taking defaults

Parameters:
parent - Parent component
name - Name of the field

PropertyMetaData

public PropertyMetaData(MetaData parent,
                        PropertyMetaData fmd)
Convenience constructor to copy the specification from the passed field. This is used when we have an overriding field and we make a copy of the baseline field as a starting point.

Parameters:
parent - The parent
fmd - The field to copy

PropertyMetaData

public PropertyMetaData(MetaData parent,
                        java.lang.String name,
                        java.lang.String pk,
                        java.lang.String modifier,
                        java.lang.String defaultFetchGroup,
                        java.lang.String nullValue,
                        java.lang.String embedded,
                        java.lang.String serialized,
                        java.lang.String dependent,
                        java.lang.String mappedBy,
                        java.lang.String column,
                        java.lang.String table,
                        java.lang.String deleteAction,
                        java.lang.String indexed,
                        java.lang.String unique,
                        java.lang.String recursionDepth,
                        java.lang.String loadFetchGroup,
                        java.lang.String valueStrategy,
                        java.lang.String foreignKey,
                        java.lang.String sequence,
                        java.lang.String fieldType,
                        java.lang.String fieldName)
Constructor. Saves the MetaData with the specified values. The object is then in an "unpopulated" state. It can become "populated" by calling the populate() method which compares it against the field it is to represent and updates any unset attributes and flags up any errors.

Parameters:
parent - parent MetaData instance
name - field name
pk - attribute primary-key value
modifier - attribute persistence-modifier value
defaultFetchGroup - attribute default-fetch-group value
nullValue - attribute null-value value
embedded - attribute embedded value
serialized - attribute serialized value
dependent - attribute dependent value
mappedBy - attribute mapped-by value
column - attribute column value
table - attribute table value
deleteAction - attribute delete-action value
indexed - Whether this is indexed
unique - Apply a unique constraint
recursionDepth - The depth of fetch to use when recursing
loadFetchGroup - Name of the additional fetch group to use when loading
valueStrategy - attribute value-strategy value
foreignKey - The foreign key name
sequence - attribute sequence value
fieldType - Implementation type(s) for field.
fieldName - field name
Method Detail

getFieldName

public java.lang.String getFieldName()
Accessor for the field name

Returns:
field name

toString

public java.lang.String toString(java.lang.String prefix,
                                 java.lang.String indent)
Returns a string representation of the object using a prefix This can be used as part of a facility to output a MetaData file.

Overrides:
toString in class AbstractPropertyMetaData
Parameters:
prefix - prefix string
indent - indent string
Returns:
a string representation of the object.

compareTo

public int compareTo(java.lang.Object o)
Comparator method. This allows the ClassMetaData to search for a PropertyMetaData with a particular name.

Specified by:
compareTo in interface java.lang.Comparable
Overrides:
compareTo in class AbstractPropertyMetaData
Parameters:
o - The object to compare against
Returns:
The comparison result


Copyright © -2007 . All Rights Reserved.