com.healthmarketscience.jackcess
Class IndexBuilder

java.lang.Object
  extended by com.healthmarketscience.jackcess.IndexBuilder

public class IndexBuilder
extends Object

Builder style class for constructing an Index. See TableBuilder for example usage.

Author:
James Ahlborn
Usage:
General: This class is general use.

Nested Class Summary
static class IndexBuilder.Column
          Information about a column in this index (name and ordering).
 
Field Summary
static String PRIMARY_KEY_NAME
          name typically used by MS Access for the primary key index
 
Constructor Summary
IndexBuilder(String name)
           
 
Method Summary
 IndexBuilder addColumns(boolean ascending, String... names)
          Adds the columns with the given ordering to the index.
 IndexBuilder addColumns(String... names)
          Adds the columns with ASCENDING ordering to the index.
 List<IndexBuilder.Column> getColumns()
           
 byte getFlags()
           
 String getName()
           
 byte getType()
           
 boolean isIgnoreNulls()
           
 boolean isPrimaryKey()
           
 boolean isUnique()
           
 IndexBuilder setIgnoreNulls()
          Sets this index to ignore null values.
 IndexBuilder setName(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(Set<String> tableColNames)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PRIMARY_KEY_NAME

public static final String PRIMARY_KEY_NAME
name typically used by MS Access for the primary key index

See Also:
Constant Field Values
Constructor Detail

IndexBuilder

public IndexBuilder(String name)
Method Detail

getName

public String getName()

getType

public byte getType()

getFlags

public byte getFlags()

isPrimaryKey

public boolean isPrimaryKey()

isUnique

public boolean isUnique()

isIgnoreNulls

public boolean isIgnoreNulls()

getColumns

public List<IndexBuilder.Column> getColumns()

setName

public IndexBuilder setName(String name)
Sets the name of the index.


addColumns

public IndexBuilder addColumns(String... names)
Adds the columns with ASCENDING ordering to the index.


addColumns

public IndexBuilder addColumns(boolean ascending,
                               String... names)
Adds the columns with the given ordering to the index.


setPrimaryKey

public IndexBuilder setPrimaryKey()
Sets this index to be a primary key index (additionally sets the index as unique).


setUnique

public IndexBuilder setUnique()
Sets this index to enforce uniqueness.


setIgnoreNulls

public IndexBuilder setIgnoreNulls()
Sets this index to ignore null values.


validate

public void validate(Set<String> tableColNames)


Copyright © 2005-2013 Health Market Science. All Rights Reserved.