Package com.mckoi.database.interpret
Class ColumnDef
java.lang.Object
com.mckoi.database.interpret.ColumnDef
- All Implemented Interfaces:
StatementTreeObject,Serializable,Cloneable
Represents a column definition (description).
- Author:
- Tobias Downer
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddConstraint(String constraint) Adds a constraint to this column.clone()Performs a DEEP clone of this object if it is mutable, or a deep clone of its mutable members.booleanReturns true if this column has the not null constraint set for it.booleanReturns true if this column has a primary key constraint set on it.booleanisUnique()Returns true if this column has the unique constraint set for it.voidprepareExpressions(ExpressionPreparer preparer) Prepares all expressions in this statement tree object by passing the ExpressionPreparer object to the 'prepare' method of the expression.voidsetDataType(TType type) Sets the type of data of this column.voidSets the default expression (this is used to make a new constraint).voidSets the indexing.voidSets the name of the column.
-
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
Sets the name of the column. -
addConstraint
Adds a constraint to this column. -
setDataType
Sets the type of data of this column. -
setIndex
Sets the indexing.- Throws:
ParseException
-
setDefaultExpression
Sets the default expression (this is used to make a new constraint). -
prepareExpressions
Description copied from interface:StatementTreeObjectPrepares all expressions in this statement tree object by passing the ExpressionPreparer object to the 'prepare' method of the expression.- Specified by:
prepareExpressionsin interfaceStatementTreeObject- Throws:
DatabaseException
-
clone
Description copied from interface:StatementTreeObjectPerforms 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:
clonein interfaceStatementTreeObject- Overrides:
clonein classObject- Throws:
CloneNotSupportedException
-