org.jpox.metadata
Class ValueMetaData

java.lang.Object
  extended byorg.jpox.metadata.MetaData
      extended byorg.jpox.metadata.ExtendableMetaData
          extended byorg.jpox.metadata.AbstractElementMetaData
              extended byorg.jpox.metadata.ValueMetaData
All Implemented Interfaces:
ColumnMetaDataContainer, java.io.Serializable

public class ValueMetaData
extends AbstractElementMetaData

This element specifies the mapping for the element component of arrays and collections. If only one column is mapped, and no additional information is needed for the column, then the column attribute can be used. Otherwise, the column element(s) are used. The serialized attribute specifies that the key values are to be serialized into the named column. The foreign-key attribute specifies the name of a foreign key to be generated.

MetaData Element

The MetaData element represented here is as follows
 
 <!ELEMENT value (extension*,embedded?,column*,foreign-key?,index?,unique?,extension*)>
 <!ATTLIST value column CDATA #IMPLIED>
 <!ATTLIST value delete-action (restrict|cascade|null|default|none) #IMPLIED>
 <!ATTLIST value indexed (true|false|unique) #IMPLIED>
 <!ATTLIST value unique (true|false) #IMPLIED>
 <!ATTLIST value mapped-by CDATA #IMPLIED>
 

Since:
1.1
Version:
$Revision: 1.18 $
See Also:
Serialized Form

Field Summary
protected  java.lang.String mappedBy
          Name of the field in the key that is the value.
 
Fields inherited from class org.jpox.metadata.AbstractElementMetaData
column, columnMetaData, columns, embeddedMetaData, foreignKeyMetaData, indexed, indexMetaData, uniqueConstraint, uniqueMetaData
 
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
ValueMetaData(MetaData parent, java.lang.String column, java.lang.String deleteAction, java.lang.String indexed, java.lang.String unique, java.lang.String mappedBy)
          Constructor.
ValueMetaData(MetaData parent, ValueMetaData vmd)
          Constructor to create a copy of the passed metadata using the provided parent.
 
Method Summary
 java.lang.String getMappedBy()
          Accessor for the field in the key that stores the value
 void populate(ClassLoaderResolver clr)
          Populate the MetaData.
 java.lang.String toString()
          Accessor for a string representation of the object.
 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.AbstractElementMetaData
addColumn, getColumn, getColumnMetaData, getEmbeddedMetaData, getForeignKeyMetaData, getIndexMetaData, getUniqueMetaData, initialise, setEmbeddedMetaData, setForeignKeyMetaData, setIndexMetaData, setUniqueMetaData
 
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
 

Field Detail

mappedBy

protected final java.lang.String mappedBy
Name of the field in the key that is the value.

Constructor Detail

ValueMetaData

public ValueMetaData(MetaData parent,
                     ValueMetaData vmd)
Constructor to create a copy of the passed metadata using the provided parent.

Parameters:
parent - The parent
vmd - The metadata to copy

ValueMetaData

public ValueMetaData(MetaData parent,
                     java.lang.String column,
                     java.lang.String deleteAction,
                     java.lang.String indexed,
                     java.lang.String unique,
                     java.lang.String mappedBy)
Constructor.

Parameters:
parent - MetaData of parent element
column - The column name
deleteAction - attribute delete-action value
indexed - Whether to index this
unique - Whether to add a unique constraint
mappedBy - Field the value is mapped by in the key object
Method Detail

getMappedBy

public java.lang.String getMappedBy()
Accessor for the field in the key that stores the value

Returns:
Field in the key that stores the value

populate

public void populate(ClassLoaderResolver clr)
Populate the MetaData.

Overrides:
populate in class AbstractElementMetaData
Parameters:
clr - Class loader to use

toString

public java.lang.String toString()
Accessor for a string representation of the object.

Overrides:
toString in class ExtendableMetaData
Returns:
a string representation of the object.

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 ExtendableMetaData
Parameters:
prefix - prefix string
indent - indent string
Returns:
a string representation of the object.


Copyright © -2007 . All Rights Reserved.