org.datanucleus.metadata
Class AbstractConstraintMetaData

java.lang.Object
  extended by org.datanucleus.metadata.MetaData
      extended by org.datanucleus.metadata.AbstractConstraintMetaData
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ForeignKeyMetaData, IndexMetaData, UniqueMetaData

public class AbstractConstraintMetaData
extends MetaData

Abstract representation of an ORM constraint.

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

Field Summary
protected  ColumnMetaData[] columnMetaData
          Contains the metadata for columns
protected  java.util.List columns
          The columns for this constraint.
protected  AbstractMemberMetaData[] memberMetaData
          Contains the metadata for fields/properties.
protected  java.util.List members
          The fields/properties for this constraint.
protected  java.lang.String name
          the constraint name
protected  java.lang.String table
          the constraint table name.
 
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
AbstractConstraintMetaData(MetaData parent, java.lang.String name, java.lang.String table)
          Constructor.
 
Method Summary
 void addColumn(ColumnMetaData colmd)
          Add a new ColumnMetaData element
 void addMember(AbstractMemberMetaData mmd)
          Add a new member that is part of this constraint.
 ColumnMetaData[] getColumnMetaData()
          Accessor for columnMetaData
 AbstractMemberMetaData[] getMemberMetaData()
          Accessor for metadata for all fields/properties that this constraint relates to.
 java.lang.String getName()
          Accessor for the name of the constraint
 int getNumberOfColumns()
          Accessor for the number of columns for this constraint.
 int getNumberOfMembers()
          Accessor for the number of fields/properties for this constraint.
 java.lang.String getTable()
          Accessor for the name of the table
 void setName(java.lang.String name)
          Mutator for the constraint name.
 
Methods inherited from class org.datanucleus.metadata.MetaData
addExtension, addExtension, getExtensions, getNoOfExtensions, getParent, getValueForExtension, getValuesForExtension, hasExtension, initialise, 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

name

protected java.lang.String name
the constraint name


table

protected java.lang.String table
the constraint table name. Name of the table to which this applies (null implies the enclosing class' table).


memberMetaData

protected AbstractMemberMetaData[] memberMetaData
Contains the metadata for fields/properties.


columnMetaData

protected ColumnMetaData[] columnMetaData
Contains the metadata for columns


members

protected java.util.List members
The fields/properties for this constraint.


columns

protected java.util.List columns
The columns for this constraint.

Constructor Detail

AbstractConstraintMetaData

public AbstractConstraintMetaData(MetaData parent,
                                  java.lang.String name,
                                  java.lang.String table)
Constructor.

Parameters:
parent - Parent (if required to be set)
name - Name of the constraint
table - Name of table for the constraint
Method Detail

addMember

public void addMember(AbstractMemberMetaData mmd)
Add a new member that is part of this constraint.

Parameters:
mmd - MetaData for the field/property

addColumn

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

Parameters:
colmd - MetaData for the column

setName

public void setName(java.lang.String name)
Mutator for the constraint name.

Parameters:
name - Name of the constraint.

getName

public final java.lang.String getName()
Accessor for the name of the constraint

Returns:
Returns the name.

getTable

public final java.lang.String getTable()
Accessor for the name of the table

Returns:
Returns the table.

getMemberMetaData

public final AbstractMemberMetaData[] getMemberMetaData()
Accessor for metadata for all fields/properties that this constraint relates to.

Returns:
Returns the memberMetaData.

getColumnMetaData

public final ColumnMetaData[] getColumnMetaData()
Accessor for columnMetaData

Returns:
Returns the columnMetaData.

getNumberOfMembers

public int getNumberOfMembers()
Accessor for the number of fields/properties for this constraint.

Returns:
Number of fields/properties

getNumberOfColumns

public int getNumberOfColumns()
Accessor for the number of columns for this constraint.

Returns:
Number of columns


Copyright © 2009. All Rights Reserved.