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.StringEXTENSION_INDEX_EXTENDED_SETTINGstatic java.lang.StringEXTENSION_INDEX_TYPEprivate booleanisUnique-
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 booleanequals(java.lang.Object obj)Equality operator.booleangetUnique()Accessor for whether the index is uniqueinthashCode()Hashcode operator.java.lang.StringtoString()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:
toStringin classjava.lang.Object- Returns:
- String version of this object.
-
-