public class IndexBuilder
extends java.lang.Object
Index. See TableBuilder for example usage.| Modifier and Type | Class and Description |
|---|---|
static class |
IndexBuilder.Column
Information about a column in this index (name and ordering).
|
| Modifier and Type | Field and Description |
|---|---|
private java.util.List<IndexBuilder.Column> |
_columns
the names and orderings of the indexed columns
|
private byte |
_flags
additional index flags (UNKNOWN_INDEX_FLAG always seems to be set in
access 2000+)
|
private java.lang.String |
_name
name of the new index
|
private byte |
_type
the type of the index
|
static java.lang.String |
PRIMARY_KEY_NAME
name typically used by MS Access for the primary key index
|
| Constructor and Description |
|---|
IndexBuilder(java.lang.String name) |
| Modifier and Type | Method and Description |
|---|---|
IndexBuilder |
addColumns(boolean ascending,
java.lang.String... names)
Adds the columns with the given ordering to the index.
|
IndexBuilder |
addColumns(java.lang.String... names)
Adds the columns with ASCENDING ordering to the index.
|
java.util.List<IndexBuilder.Column> |
getColumns() |
byte |
getFlags() |
java.lang.String |
getName() |
byte |
getType() |
boolean |
isIgnoreNulls() |
boolean |
isPrimaryKey() |
boolean |
isUnique() |
IndexBuilder |
setIgnoreNulls()
Sets this index to ignore null values.
|
IndexBuilder |
setName(java.lang.String name)
Sets the name of the index.
|
IndexBuilder |
setPrimaryKey()
Sets this index to be a primary key index (additionally sets the index as
unique).
|
IndexBuilder |
setUnique()
Sets this index to enforce uniqueness.
|
void |
validate(java.util.Set<java.lang.String> tableColNames,
JetFormat format) |
private java.lang.String |
withErrorContext(java.lang.String msg) |
public static final java.lang.String PRIMARY_KEY_NAME
private java.lang.String _name
private byte _type
private byte _flags
private final java.util.List<IndexBuilder.Column> _columns
public java.lang.String getName()
public byte getType()
public byte getFlags()
public boolean isPrimaryKey()
public boolean isUnique()
public boolean isIgnoreNulls()
public java.util.List<IndexBuilder.Column> getColumns()
public IndexBuilder setName(java.lang.String name)
public IndexBuilder addColumns(java.lang.String... names)
public IndexBuilder addColumns(boolean ascending, java.lang.String... names)
public IndexBuilder setPrimaryKey()
public IndexBuilder setUnique()
public IndexBuilder setIgnoreNulls()
public void validate(java.util.Set<java.lang.String> tableColNames,
JetFormat format)
private java.lang.String withErrorContext(java.lang.String msg)