Package org.datanucleus.store.rdbms.key
Class Index
- java.lang.Object
-
- org.datanucleus.store.rdbms.key.Key
-
- org.datanucleus.store.rdbms.key.ColumnOrderedKey
-
- org.datanucleus.store.rdbms.key.Index
-
public class Index extends ColumnOrderedKey
Representation of an INDEX.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
EXTENSION_INDEX_EXTENDED_SETTING
static java.lang.String
EXTENSION_INDEX_TYPE
private boolean
isUnique
-
Fields inherited from class org.datanucleus.store.rdbms.key.ColumnOrderedKey
columnOrdering, extensions
-
-
Constructor Summary
Constructors Constructor Description Index(CandidateKey ck)
Constructor for an index for the specified candidate key.Index(ForeignKey fk)
Constructor for an index for the specified foreign key.Index(Table table, boolean isUnique, java.util.Map<java.lang.String,java.lang.String> extensions)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object obj)
Equality operator.boolean
getUnique()
Accessor for whether the index is uniqueint
hashCode()
Hashcode operator.java.lang.String
toString()
Stringify method.-
Methods inherited from class org.datanucleus.store.rdbms.key.ColumnOrderedKey
addColumn, getColumnList, getValueForExtension, setColumn, setColumnOrdering
-
Methods inherited from class org.datanucleus.store.rdbms.key.Key
assertSameDatastoreObject, getColumnList, getColumnList, getColumns, getName, getNumberOfColumns, getTable, setListMinimumSize, setName
-
-
-
-
Field Detail
-
EXTENSION_INDEX_EXTENDED_SETTING
public static final java.lang.String EXTENSION_INDEX_EXTENDED_SETTING
- See Also:
- Constant Field Values
-
EXTENSION_INDEX_TYPE
public static final java.lang.String EXTENSION_INDEX_TYPE
- See Also:
- Constant Field Values
-
isUnique
private final boolean isUnique
-
-
Constructor Detail
-
Index
public Index(Table table, boolean isUnique, java.util.Map<java.lang.String,java.lang.String> extensions)
Constructor.- Parameters:
table
- The tableisUnique
- Whether the index is uniqueextensions
- Any extensions for the index
-
Index
public Index(CandidateKey ck)
Constructor for an index for the specified candidate key.- Parameters:
ck
- Candidate key to use as a basis
-
Index
public Index(ForeignKey fk)
Constructor for an index for the specified foreign key.- Parameters:
fk
- Foreign key to use as a basis
-
-
Method Detail
-
getUnique
public boolean getUnique()
Accessor for whether the index is unique- Returns:
- Whether it is unique.
-
hashCode
public int hashCode()
Hashcode operator.
-
equals
public boolean equals(java.lang.Object obj)
Equality operator.
-
toString
public java.lang.String toString()
Stringify method. Generates a form of the index ready to be used in a DDL statement. e.gINDEX (col1, col2)
- Overrides:
toString
in classjava.lang.Object
- Returns:
- String version of this object.
-
-