public class Index extends Object implements Copyable<Index>, Serializable
index
.
It has properties like name
, type
and
columns
.
DBMetaData
,
Serialized FormModifier and Type | Class and Description |
---|---|
static class |
Index.IndexType
A enumeration generally used for typify the
Index . |
Constructor and Description |
---|
Index(String name,
Index.IndexType type,
String... columns)
|
Modifier and Type | Method and Description |
---|---|
Index |
clone()
Returns a field-for-field copy of this instance.
|
boolean |
containsColumn(String name)
Returns true if this
Index contains the specified
column. |
boolean |
equals(Object obj) |
String[] |
getColumns()
Returns the type of this
Index . |
String |
getName()
Returns the name of this
Index . |
Index.IndexType |
getType()
Returns the type of this
Index . |
int |
hashCode() |
boolean |
isUnique()
Returns true if this
Index is a unique index. |
void |
setColumns(String[] columns)
Sets the columns for this
Index . |
void |
setName(String name)
Sets the name for this
Index . |
void |
setType(Index.IndexType type)
Sets the
Index.IndexType for this Index . |
String |
toString() |
public Index(String name, Index.IndexType type, String... columns)
name
- the name of this Index
type
- to typify this Index
columns
- the columns on which the Index
isIndex.IndexType
public void setName(String name)
Index
.name
- the new namepublic void setType(Index.IndexType type)
Index.IndexType
for this Index
.type
- the type for this Index
. One of the following
constants defined in IndexType
:
NORMAL
UNIQUE
PRIMARY_KEY
public Index.IndexType getType()
Index
.Index.IndexType
of this Index
public void setColumns(String[] columns)
Index
.columns
- an array of strings with the columnspublic String[] getColumns()
Index
.public boolean containsColumn(String name)
Index
contains the specified
column.name
- the column nameIndex
contains the specified
column, otherwise falsepublic boolean isUnique()
Index
is a unique index.Index
is unique, otherwise
falseCopyright © 2003–2022 XDEV Software. All rights reserved.