org.jpox.metadata
Class UniqueMetaData

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

public class UniqueMetaData
extends ExtendableMetaData
implements ColumnMetaDataContainer

MetaData representing a unique constraint.

MetaData Element

The MetaData Element represented here is as follows
 <!ELEMENT unique (extension*, (column|field|property)*, extension*)>
 <!ATTLIST unique name CDATA #IMPLIED>
 <!ATTLIST unique table CDATA #IMPLIED>
 <!ATTLIST unique deferred (true|false) 'false'>
 

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

Field Summary
protected  ColumnMetaData[] columnMetaData
          Contains the metadata for column
protected  java.util.List columns
          the columns elements to be included in the index.
protected  AbstractPropertyMetaData[] fieldMetaData
          Contains the metadata for field
protected  java.util.List fields
          the fields elements to be included in the index.
 
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
UniqueMetaData(MetaData parent, java.lang.String name, java.lang.String table, java.lang.String deferredValue)
          Constructor.
UniqueMetaData(MetaData parent, UniqueMetaData umd)
          Constructor to create a copy of the passed metadata using the provided parent.
 
Method Summary
 void addColumn(ColumnMetaData colmd)
          Add a new ColumnMetaData element
 void addField(AbstractPropertyMetaData fmd)
          Add a new Field.
 ColumnMetaData[] getColumnMetaData()
          Accessor for columnMetaData
 AbstractPropertyMetaData[] getFieldMetaData()
          Accessor for fieldMetaData
 java.lang.String getName()
          Accessor for the name of the unique constraint
 java.lang.String getTable()
          Accessor for the table.
 void initialise()
          Method to initialise the object, creating internal convenience arrays.
 boolean isDeferred()
          Accessor for whether the unique constraint is deferred.
 java.lang.String toString()
          Returns 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.
 
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

fieldMetaData

protected AbstractPropertyMetaData[] fieldMetaData
Contains the metadata for field


columnMetaData

protected ColumnMetaData[] columnMetaData
Contains the metadata for column


fields

protected java.util.List fields
the fields elements to be included in the index. Can be empty.


columns

protected java.util.List columns
the columns elements to be included in the index. Suitable to be empty when this metadata is contained within a field, element, key, value, or join elements

Constructor Detail

UniqueMetaData

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

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

UniqueMetaData

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

Parameters:
parent - MetaData for parent
name - Name of unique constraint
table - Name of the table
deferredValue - Whether the unique is deferred initially
Method Detail

initialise

public void initialise()
Method to initialise the object, creating internal convenience arrays. Initialise all sub-objects.

Overrides:
initialise in class MetaData

addField

public void addField(AbstractPropertyMetaData fmd)
Add a new Field.

Parameters:
fmd - the FieldMetadata to add

addColumn

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

Specified by:
addColumn in interface ColumnMetaDataContainer
Parameters:
colmd - The ColumnMetaData to add

getFieldMetaData

public final AbstractPropertyMetaData[] getFieldMetaData()
Accessor for fieldMetaData

Returns:
Returns the fieldMetaData.

getColumnMetaData

public final ColumnMetaData[] getColumnMetaData()
Accessor for columnMetaData

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

getName

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

Returns:
Returns the name.

getTable

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

Returns:
Returns the table..

isDeferred

public final boolean isDeferred()
Accessor for whether the unique constraint is deferred.

Returns:
Returns whether the unique constraint is deferred

toString

public java.lang.String toString()
Returns 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. 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.