Class ColumnDef

java.lang.Object
com.mckoi.database.interpret.ColumnDef
All Implemented Interfaces:
StatementTreeObject, Serializable, Cloneable

public final class ColumnDef extends Object implements Serializable, StatementTreeObject, Cloneable
Represents a column definition (description).
Author:
Tobias Downer
See Also:
  • Constructor Details

    • ColumnDef

      public ColumnDef()
  • Method Details

    • isPrimaryKey

      public boolean isPrimaryKey()
      Returns true if this column has a primary key constraint set on it.
    • isUnique

      public boolean isUnique()
      Returns true if this column has the unique constraint set for it.
    • isNotNull

      public boolean isNotNull()
      Returns true if this column has the not null constraint set for it.
    • setName

      public void setName(String name)
      Sets the name of the column.
    • addConstraint

      public void addConstraint(String constraint)
      Adds a constraint to this column.
    • setDataType

      public void setDataType(TType type)
      Sets the type of data of this column.
    • setIndex

      public void setIndex(Token t) throws ParseException
      Sets the indexing.
      Throws:
      ParseException
    • setDefaultExpression

      public void setDefaultExpression(Expression exp)
      Sets the default expression (this is used to make a new constraint).
    • prepareExpressions

      public void prepareExpressions(ExpressionPreparer preparer) throws DatabaseException
      Description copied from interface: StatementTreeObject
      Prepares all expressions in this statement tree object by passing the ExpressionPreparer object to the 'prepare' method of the expression.
      Specified by:
      prepareExpressions in interface StatementTreeObject
      Throws:
      DatabaseException
    • clone

      public Object clone() throws CloneNotSupportedException
      Description copied from interface: StatementTreeObject
      Performs a DEEP clone of this object if it is mutable, or a deep clone of its mutable members. If the object is immutable then it may return 'this'.
      Specified by:
      clone in interface StatementTreeObject
      Overrides:
      clone in class Object
      Throws:
      CloneNotSupportedException