org.datanucleus.metadata
Class IndexMetaData

java.lang.Object
  extended by org.datanucleus.metadata.MetaData
      extended by org.datanucleus.metadata.AbstractConstraintMetaData
          extended by org.datanucleus.metadata.IndexMetaData
All Implemented Interfaces:
java.io.Serializable, ColumnMetaDataContainer

public class IndexMetaData
extends AbstractConstraintMetaData
implements ColumnMetaDataContainer

For schema generation, it might be useful to specify that a column or columns be indexed, and to provide the name of the index. For this purpose, an index element can be contained within a field, element, key, value, or join element, and this indicates that the column(s) associated with the referenced element should be indexed. Indexes can also be specified at the class level, by including index elements containing column elements. In this case, the column elements are mapped elsewhere, and the column elements contain only the column name.

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

Field Summary
 
Fields inherited from class org.datanucleus.metadata.AbstractConstraintMetaData
columnMetaData, columns, memberMetaData, members, name, table
 
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
IndexMetaData(IndexMetaData imd)
          Constructor to create a copy of the passed metadata.
IndexMetaData(java.lang.String name, java.lang.String table, java.lang.String unique)
          Constructor.
 
Method Summary
 void initialise()
          Method to initialise the object, creating internal convenience arrays.
 java.lang.Boolean isUnique()
          Accessor for whether the index is unique
 java.lang.String toString(java.lang.String prefix, java.lang.String indent)
          Returns a string representation of the object.
 
Methods inherited from class org.datanucleus.metadata.AbstractConstraintMetaData
addColumn, addMember, getColumnMetaData, getMemberMetaData, getName, getNumberOfColumns, getNumberOfMembers, getTable, setName
 
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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.datanucleus.metadata.ColumnMetaDataContainer
addColumn, getColumnMetaData
 

Constructor Detail

IndexMetaData

public IndexMetaData(IndexMetaData imd)
Constructor to create a copy of the passed metadata.

Parameters:
imd - The metadata to copy

IndexMetaData

public IndexMetaData(java.lang.String name,
                     java.lang.String table,
                     java.lang.String unique)
Constructor.

Parameters:
name - Name of index
table - Name of the table
unique - Whether it is unique.
Method Detail

initialise

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

Overrides:
initialise in class MetaData

isUnique

public final java.lang.Boolean isUnique()
Accessor for whether the index is unique

Returns:
Returns whether the index is unique.

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


Copyright © 2009. All Rights Reserved.