org.datanucleus.metadata
Class IndexMetaData
java.lang.Object
org.datanucleus.metadata.MetaData
org.datanucleus.metadata.AbstractConstraintMetaData
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
|
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.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 |
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 indextable - Name of the tableunique - Whether it is unique.
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 stringindent - indent string
- Returns:
- a string representation of the object.
Copyright © 2009. All Rights Reserved.