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.

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()
          Default constructor.
IndexMetaData(IndexMetaData imd)
          Constructor to create a copy of the passed metadata.
 
Method Summary
 java.lang.String getName()
           
 java.lang.String getTable()
           
 boolean isUnique()
           
 void setName(java.lang.String name)
           
 void setTable(java.lang.String table)
           
 IndexMetaData setUnique(boolean unique)
           
 IndexMetaData setUnique(java.lang.String 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, getNumberOfColumns, getNumberOfMembers, initialise, newColumnMetaData, newFieldMetaData, newPropertyMetaData
 
Methods inherited from class org.datanucleus.metadata.MetaData
addExtension, addExtension, assertIfInitialised, getExtensions, getNoOfExtensions, getParent, getValueForExtension, getValuesForExtension, hasExtension, isInitialised, isPopulated, isUsed, newExtensionMetaData, removeExtension, setParent, 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()
Default constructor. Set fields using setters, before populate().

Method Detail

getName

public java.lang.String getName()

setName

public void setName(java.lang.String name)

getTable

public java.lang.String getTable()

setTable

public void setTable(java.lang.String table)

isUnique

public final boolean isUnique()

setUnique

public IndexMetaData setUnique(boolean unique)

setUnique

public IndexMetaData setUnique(java.lang.String 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 © 2010. All Rights Reserved.