org.datanucleus.metadata
Class AbstractElementMetaData

java.lang.Object
  extended by org.datanucleus.metadata.MetaData
      extended by org.datanucleus.metadata.AbstractElementMetaData
All Implemented Interfaces:
java.io.Serializable, ColumnMetaDataContainer
Direct Known Subclasses:
ElementMetaData, KeyMetaData, ValueMetaData

public abstract class AbstractElementMetaData
extends MetaData
implements ColumnMetaDataContainer

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.

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

Field Summary
protected  ColumnMetaData[] columnMetaData
           
protected  java.lang.String columnName
          column name value.
protected  java.util.List columns
          Columns ColumnMetaData
protected  EmbeddedMetaData embeddedMetaData
          EmbeddedMetaData
protected  ForeignKeyMetaData foreignKeyMetaData
          ForeignKeyMetaData
protected  IndexedValue indexed
          The indexing value
protected  IndexMetaData indexMetaData
          IndexMetaData
protected  java.lang.String mappedBy
          Field that this is mapped to.
protected  boolean uniqueConstraint
          Whether to add a unique constraint
protected  UniqueMetaData uniqueMetaData
          UniqueMetaData.
 
Fields inherited from class org.datanucleus.metadata.MetaData
extensions, LOCALISER, METADATA_CREATED_STATE, METADATA_INITIALISED_STATE, METADATA_POPULATED_STATE, METADATA_USED_STATE, metaDataState, parent, VENDOR_NAME, VENDOR_NAME_OLD
 
Constructor Summary
AbstractElementMetaData(MetaData parent, AbstractElementMetaData aemd)
          Constructor to create a copy of the passed metadata object applying the passed parent.
AbstractElementMetaData(MetaData parent, java.lang.String columnName, java.lang.String deleteAction, java.lang.String updateAction, java.lang.String indexed, java.lang.String unique, java.lang.String mappedBy)
          Constructor.
 
Method Summary
 void addColumn(ColumnMetaData colmd)
          Add a new ColumnMetaData element
 ColumnMetaData[] getColumnMetaData()
          Accessor for columnMetaData
 java.lang.String getColumnName()
          Accessor for column name.
 EmbeddedMetaData getEmbeddedMetaData()
          Accessor for embeddedMetaData
 ForeignKeyMetaData getForeignKeyMetaData()
          Accessor for foreignKeyMetaData
 IndexMetaData getIndexMetaData()
          Accessor for indexMetaData
 java.lang.String getMappedBy()
          Accessor for the field in the value that stores the key
 UniqueMetaData getUniqueMetaData()
          Accessor for uniqueMetaData
 void initialise()
          Method to initialise the object, creating any convenience arrays needed.
 void populate(ClassLoaderResolver clr, java.lang.ClassLoader primary)
          Populate the metadata
 void setEmbeddedMetaData(EmbeddedMetaData embeddedMetaData)
          Mutator for the Embedded MetaData
 void setForeignKeyMetaData(ForeignKeyMetaData foreignKeyMetaData)
          Mutator for the Foreign Key MetaData
 void setIndexMetaData(IndexMetaData indexMetaData)
          Mutator for the Index MetaData
 void setUniqueMetaData(UniqueMetaData uniqueMetaData)
          Mutator for the Unique MetaData
 
Methods inherited from class org.datanucleus.metadata.MetaData
addExtension, addExtension, getExtensions, getNoOfExtensions, getParent, getValueForExtension, getValuesForExtension, hasExtension, isInitialised, isPopulated, isUsed, removeExtension, setInitialised, setParent, setPopulated, setUsed, toString, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

columns

protected final java.util.List columns
Columns ColumnMetaData


indexMetaData

protected IndexMetaData indexMetaData
IndexMetaData


indexed

protected IndexedValue indexed
The indexing value


uniqueMetaData

protected UniqueMetaData uniqueMetaData
UniqueMetaData.


uniqueConstraint

protected final boolean uniqueConstraint
Whether to add a unique constraint


foreignKeyMetaData

protected ForeignKeyMetaData foreignKeyMetaData
ForeignKeyMetaData


embeddedMetaData

protected EmbeddedMetaData embeddedMetaData
EmbeddedMetaData


columnName

protected java.lang.String columnName
column name value.


mappedBy

protected java.lang.String mappedBy
Field that this is mapped to.


columnMetaData

protected ColumnMetaData[] columnMetaData
Constructor Detail

AbstractElementMetaData

public AbstractElementMetaData(MetaData parent,
                               AbstractElementMetaData aemd)
Constructor to create a copy of the passed metadata object applying the passed parent.

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

AbstractElementMetaData

public AbstractElementMetaData(MetaData parent,
                               java.lang.String columnName,
                               java.lang.String deleteAction,
                               java.lang.String updateAction,
                               java.lang.String indexed,
                               java.lang.String unique,
                               java.lang.String mappedBy)
Constructor.

Parameters:
parent - Parent element
columnName - Name of column
deleteAction - attribute delete-action value
updateAction - attribute update-action value
indexed - The indexing value
unique - Whether to add a unique constraint
mappedBy - Mapped-by field for this element/key/value
Method Detail

populate

public void populate(ClassLoaderResolver clr,
                     java.lang.ClassLoader primary)
Populate the metadata

Parameters:
clr - the ClassLoaderResolver
primary - the primary ClassLoader to use (or null)

initialise

public void initialise()
Method to initialise the object, creating any convenience arrays needed. Initialises all sub-objects.

Overrides:
initialise in class MetaData

getColumnName

public final java.lang.String getColumnName()
Accessor for column name.

Returns:
Returns the column name.

getMappedBy

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

Returns:
Field in the value that stores the key

getColumnMetaData

public final ColumnMetaData[] getColumnMetaData()
Accessor for columnMetaData

Specified by:
getColumnMetaData in interface ColumnMetaDataContainer
Returns:
Returns the columnMetaData.

getEmbeddedMetaData

public final EmbeddedMetaData getEmbeddedMetaData()
Accessor for embeddedMetaData

Returns:
Returns the embeddedMetaData.

getForeignKeyMetaData

public final ForeignKeyMetaData getForeignKeyMetaData()
Accessor for foreignKeyMetaData

Returns:
Returns the foreignKeyMetaData.

getIndexMetaData

public final IndexMetaData getIndexMetaData()
Accessor for indexMetaData

Returns:
Returns the indexMetaData.

getUniqueMetaData

public final UniqueMetaData getUniqueMetaData()
Accessor for uniqueMetaData

Returns:
Returns the uniqueMetaData.

addColumn

public void addColumn(ColumnMetaData colmd)
Add a new ColumnMetaData element

Specified by:
addColumn in interface ColumnMetaDataContainer
Parameters:
colmd - The Column MetaData

setEmbeddedMetaData

public final void setEmbeddedMetaData(EmbeddedMetaData embeddedMetaData)
Mutator for the Embedded MetaData

Parameters:
embeddedMetaData - The embeddedMetaData to set.

setForeignKeyMetaData

public final void setForeignKeyMetaData(ForeignKeyMetaData foreignKeyMetaData)
Mutator for the Foreign Key MetaData

Parameters:
foreignKeyMetaData - The foreignKeyMetaData to set.

setIndexMetaData

public final void setIndexMetaData(IndexMetaData indexMetaData)
Mutator for the Index MetaData

Parameters:
indexMetaData - The indexMetaData to set.

setUniqueMetaData

public final void setUniqueMetaData(UniqueMetaData uniqueMetaData)
Mutator for the Unique MetaData

Parameters:
uniqueMetaData - The uniqueMetaData to set.


Copyright © 2009. All Rights Reserved.