public class Index extends Element
| Modifier and Type | Field and Description |
|---|---|
private java.util.List<Tuple<java.lang.String,java.lang.Boolean>> |
columns
List of columns the index is attached to.
|
private boolean |
primary
Is primary?
This property is only mutable because the standard JDBC API does not provide information whether the
index is primary.
|
private boolean |
unique
Is unique?
|
| Constructor and Description |
|---|
Index(java.lang.String name,
Table table,
boolean unique,
boolean primary,
java.lang.String comment)
Default constructor.
|
Index(java.lang.String name,
Table table,
java.util.Collection<Tuple<java.lang.String,java.lang.Boolean>> cols,
boolean unique,
boolean primary,
java.lang.String comment)
Second constructor, that allows to fill columns on creation.
|
| Modifier and Type | Method and Description |
|---|---|
java.util.List<Tuple<java.lang.String,java.lang.Boolean>> |
getColumns()
Getter for columns.
|
boolean |
getPrimary()
Getter for primary.
|
boolean |
getUnique()
Getter for unique.
|
void |
setPrimary(boolean isPrimary)
Setter for primary.
|
private final java.util.List<Tuple<java.lang.String,java.lang.Boolean>> columns
String and a Boolean representing the sort direction (true is ASCENDING)).private final boolean unique
private boolean primary
public Index(java.lang.String name,
Table table,
boolean unique,
boolean primary,
java.lang.String comment)
name - Most basic property of any element - its name.table - Table containing the index (parent).unique - Is unique?primary - Is primary?comment - Comment for the index.public Index(java.lang.String name,
Table table,
java.util.Collection<Tuple<java.lang.String,java.lang.Boolean>> cols,
boolean unique,
boolean primary,
java.lang.String comment)
name - Most basic property of any element - it's name.table - Table containing the index (parent).cols - List of columns the index is attached to. The elements of this list are composed of the column
name (as a String and a Boolean representing the sort direction (true
is ASCENDING)).unique - Is unique?primary - Is primary?comment - Comment for the index.public java.util.List<Tuple<java.lang.String,java.lang.Boolean>> getColumns()
String and a Boolean representing the sort direction (true
is ASCENDING)).public boolean getUnique()
public boolean getPrimary()
public void setPrimary(boolean isPrimary)
isPrimary - Is primary?