public class CreateTableColumn extends PostgresSqlPart
Generates a column definition for a CREATE TABLE
statement for PostgreSQL.
"email" text NOT NULL CONSTRAINT "email_check" CHECK (email LIKE '%@%')
Constructor and Description |
---|
CreateTableColumn() |
CreateTableColumn(String columnName,
TableColumnType type) |
CreateTableColumn(String columnName,
TableColumnType type,
Integer length) |
CreateTableColumn(String columnName,
TableColumnType type,
Integer length,
Integer scale) |
escapeKeyword
collectParameterValues, getParameterValues, getSqlFragment, isPretty, printSqlParts, toString
public CreateTableColumn()
public CreateTableColumn(String columnName, TableColumnType type, Integer length, Integer scale)
public CreateTableColumn(String columnName, TableColumnType type, Integer length)
public CreateTableColumn(String columnName, TableColumnType type)
public CreateTableColumn setPretty(boolean pretty)
public void collectSqlFragment(CodeWriter writer)
collectSqlFragment
in class SqlPart
public String getColumnName()
public CreateTableColumn setColumnName(String columnName)
public TableColumnType getType()
public CreateTableColumn setType(TableColumnType type)
public Integer getLength()
public CreateTableColumn setLength(Integer length)
public Integer getScale()
public CreateTableColumn setScale(Integer scale)
public boolean isNullable()
public CreateTableColumn setNullable(boolean nullable)
public boolean isUnique()
public CreateTableColumn setUnique(boolean unique)
public String getDefaultValue()
public CreateTableColumn setDefaultValue(String defaultValue)
public String getCheckConstraintCondition()
public CreateTableColumn setCheckConstraintCondition(String checkConstraintCondition)
public String getCheckConstraintName()
public CreateTableColumn setCheckConstraintName(String checkConstraintName)
public CreateTableColumn setCheckConstraint(String checkConstraintName, String condition)
Appends a check constraint to the column definition.
CONSTRAINT "check_constraint_name" CHECK (check_condition)
public boolean isPrimaryKey()
public CreateTableColumn setPrimaryKey(boolean primaryKey)
Copyright (c) 2006-2024 North Concepts Inc. All Rights Reserved.