Class Index
java.lang.Object
org.apache.openjpa.jdbc.schema.Constraint
org.apache.openjpa.jdbc.schema.LocalConstraint
org.apache.openjpa.jdbc.schema.Index
- All Implemented Interfaces:
Serializable
Represents a database index. Can also represent a partial index,
aligning with
DatabaseMetaData.- Author:
- Abe White, Stephen Kim
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidderef()booleanequalsIndex(Index idx) Indexes are equal if they have the same name, the same columns, and are both unique/not unique.Deprecated.intbooleanisColumnDescending(Column col) Whether the given column is sorted in descending order.booleanReturn whether this constraint is a logical constraint only; i.e. if it does not exist in the database.booleanisUnique()Return true if this is a UNIQUE index.voidref()voidsetColumnSortDirection(DBIdentifier col, boolean descending) Set the sort direction for a column in this index.voidsetUnique(boolean unique) Set whether this is a UNIQUE index.Methods inherited from class LocalConstraint
addColumn, columnsMatch, containsColumn, derefColumns, equalsLocalConstraint, getColumns, refColumns, removeColumn, setColumnsMethods inherited from class Constraint
equals, getColumnIdentifier, getColumnName, getIdentifier, getName, getQualifiedPath, getSchemaIdentifier, getSchemaName, getTable, getTableIdentifier, getTableName, hashCode, isDeferred, setColumnIdentifier, setColumnName, setDeferred, setIdentifier, setName, setSchemaIdentifier, setSchemaName, setTableIdentifier, setTableName, toString
-
Constructor Details
-
Index
public Index()Default constructor. -
Index
Deprecated.Constructor.- Parameters:
name- the name of the indextable- the table of the index
-
Index
-
-
Method Details
-
isUnique
public boolean isUnique()Return true if this is a UNIQUE index. -
setUnique
public void setUnique(boolean unique) Set whether this is a UNIQUE index. -
setColumnSortDirection
Set the sort direction for a column in this index.- Parameters:
col- the column identifierdescending- true for DESC, false for ASC (default)
-
isColumnDescending
Whether the given column is sorted in descending order. -
isLogical
public boolean isLogical()Description copied from class:ConstraintReturn whether this constraint is a logical constraint only; i.e. if it does not exist in the database.- Specified by:
isLogicalin classConstraint
-
getFullName
Deprecated.Description copied from class:ConstraintReturn the full name of the constraint.- Overrides:
getFullNamein classConstraint
-
getFullIdentifier
- Overrides:
getFullIdentifierin classConstraint
-
equalsIndex
Indexes are equal if they have the same name, the same columns, and are both unique/not unique. -
getRefCount
public int getRefCount() -
ref
public void ref() -
deref
public void deref()
-