| java.lang.Object org.jpox.metadata.MetaData org.jpox.metadata.AbstractConstraintMetaData org.jpox.metadata.IndexMetaData
IndexMetaData | public class IndexMetaData extends AbstractConstraintMetaData implements ColumnMetaDataContainer(Code) | | 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 $ |
Field Summary | |
Boolean | unique You can use UNIQUE constraints to ensure that no duplicate values are
entered in specific columns that do not participate in a primary key.
Although both a UNIQUE constraint and a PRIMARY KEY constraint enforce
uniqueness, use a UNIQUE constraint instead of a PRIMARY KEY constraint
when you want to enforce the uniqueness of:
-
A column, or combination of columns, that is not the primary key.
Multiple UNIQUE constraints can be defined on a table, whereas only one
PRIMARY KEY constraint can be defined on a table.
-
A column that allows null values.
|
Method Summary | |
public void | initialise() Method to initialise the object, creating internal convenience arrays. | final public Boolean | isUnique() | public String | toString(String prefix, String indent) Returns a string representation of the object.
This can be used as part of a facility to output a MetaData file. |
unique | Boolean unique(Code) | | You can use UNIQUE constraints to ensure that no duplicate values are
entered in specific columns that do not participate in a primary key.
Although both a UNIQUE constraint and a PRIMARY KEY constraint enforce
uniqueness, use a UNIQUE constraint instead of a PRIMARY KEY constraint
when you want to enforce the uniqueness of:
-
A column, or combination of columns, that is not the primary key.
Multiple UNIQUE constraints can be defined on a table, whereas only one
PRIMARY KEY constraint can be defined on a table.
-
A column that allows null values. UNIQUE constraints can be defined on
columns that allow null values, whereas PRIMARY KEY constraints can be
defined only on columns that do not allow null values.
A UNIQUE constraint can also be referenced by a FOREIGN KEY constraint.
|
IndexMetaData | public IndexMetaData(IndexMetaData imd)(Code) | | Constructor to create a copy of the passed metadata.
Parameters: imd - The metadata to copy |
IndexMetaData | public IndexMetaData(String name, String table, String unique)(Code) | | Constructor.
Parameters: name - Name of index Parameters: table - Name of the table Parameters: unique - Whether it is unique. |
initialise | public void initialise()(Code) | | Method to initialise the object, creating internal convenience arrays.
Initialise all sub-objects.
|
isUnique | final public Boolean isUnique()(Code) | | Accessor for whether the index is unique
Returns whether the index is unique. |
toString | public String toString(String prefix, String indent)(Code) | | Returns a string representation of the object.
This can be used as part of a facility to output a MetaData file.
Parameters: prefix - prefix string Parameters: indent - indent string a string representation of the object. |
|
|