Elexis API documentation
Version 2.1.6 as of December 11 2011

com.healthmarketscience.jackcess
Class ColumnBuilder

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

public class ColumnBuilder
extends java.lang.Object

Builder style class for constructing a Column.

Author:
James Ahlborn

Constructor Summary
ColumnBuilder(java.lang.String name)
           
ColumnBuilder(java.lang.String name, DataType type)
           
 
Method Summary
 ColumnBuilder escapeName()
          Escapes the new column's name using Database.escapeIdentifier(java.lang.String).
 ColumnBuilder setAutoNumber(boolean autoNumber)
          Sets whether of not the new column is an auto-number column.
 ColumnBuilder setCompressedUnicode(boolean compressedUnicode)
          Sets whether of not the new column allows unicode compression.
 ColumnBuilder setFromColumn(Column template)
          Sets all attributes except name from the given Column template.
 ColumnBuilder setLength(int length)
          Sets the length (in bytes) for the new column.
 ColumnBuilder setLengthInUnits(int unitLength)
          Sets the length (in type specific units) for the new column.
 ColumnBuilder setMaxLength()
          Sets the length for the new column to the max length for the type.
 ColumnBuilder setPrecision(int newPrecision)
          Sets the precision for the new column.
 ColumnBuilder setScale(int newScale)
          Sets the scale for the new column.
 ColumnBuilder setSQLType(int type)
          Sets the type for the new column based on the given SQL type.
 ColumnBuilder setSQLType(int type, int lengthInUnits)
          Sets the type for the new column based on the given SQL type and target data length (in type specific units).
 ColumnBuilder setType(DataType type)
          Sets the type for the new column.
 Column toColumn()
          Creates a new Column with the currently configured attributes.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ColumnBuilder

public ColumnBuilder(java.lang.String name)

ColumnBuilder

public ColumnBuilder(java.lang.String name,
                     DataType type)
Method Detail

setType

public ColumnBuilder setType(DataType type)
Sets the type for the new column.


setSQLType

public ColumnBuilder setSQLType(int type)
                         throws java.sql.SQLException
Sets the type for the new column based on the given SQL type.

Throws:
java.sql.SQLException

setSQLType

public ColumnBuilder setSQLType(int type,
                                int lengthInUnits)
                         throws java.sql.SQLException
Sets the type for the new column based on the given SQL type and target data length (in type specific units).

Throws:
java.sql.SQLException

setPrecision

public ColumnBuilder setPrecision(int newPrecision)
Sets the precision for the new column.


setScale

public ColumnBuilder setScale(int newScale)
Sets the scale for the new column.


setLength

public ColumnBuilder setLength(int length)
Sets the length (in bytes) for the new column.


setLengthInUnits

public ColumnBuilder setLengthInUnits(int unitLength)
Sets the length (in type specific units) for the new column.


setMaxLength

public ColumnBuilder setMaxLength()
Sets the length for the new column to the max length for the type.


setAutoNumber

public ColumnBuilder setAutoNumber(boolean autoNumber)
Sets whether of not the new column is an auto-number column.


setCompressedUnicode

public ColumnBuilder setCompressedUnicode(boolean compressedUnicode)
Sets whether of not the new column allows unicode compression.


setFromColumn

public ColumnBuilder setFromColumn(Column template)
Sets all attributes except name from the given Column template.


escapeName

public ColumnBuilder escapeName()
Escapes the new column's name using Database.escapeIdentifier(java.lang.String).


toColumn

public Column toColumn()
Creates a new Column with the currently configured attributes.


Elexis API documentation
Version 2.1.6 as of December 11 2011

Copyright 2005-2011 by Gerry Weirich, Elexis