| Constructor and Description |
|---|
DbColumn(DbTable parent,
String name,
String typeName,
Integer typeLength) |
DbColumn(DbTable parent,
String name,
String typeName,
Object... typeQualifiers) |
| Modifier and Type | Method and Description |
|---|---|
<T extends DbConstraint> |
addConstraint(T constraint)
Adds the given constraint to this column.
|
DbCheckConstraint |
checkCondition(String name,
Condition condition)
Creates and adds check constraint with the given parameters to this
table.
|
String |
getColumnNameSQL() |
List<DbConstraint> |
getConstraints() |
Object |
getDefaultValue() |
DbTable |
getTable() |
Integer |
getTypeLength() |
static String |
getTypeName(int type)
Returns the standard jdbc type name for the give type value (one of
Types). |
String |
getTypeNameSQL() |
List<Object> |
getTypeQualifiers() |
DbConstraint |
notNull()
Creates and adds not null constraint with the given parameters to this
column.
|
DbConstraint |
notNull(String name)
Creates and adds not null constraint with the given parameters to this
column.
|
DbConstraint |
primaryKey()
Creates and adds primary key constraint with the given parameters to this
column.
|
DbConstraint |
primaryKey(String name)
Creates and adds primary key constraint with the given parameters to this
column.
|
DbForeignKeyConstraint |
references(String referencedTableName)
Creates and adds foreign key constraint with the given parameters to this
column.
|
DbForeignKeyConstraint |
references(String name,
DbTable referencedTable,
DbColumn referencedColumn)
Creates and adds foreign key constraint with the given parameters to this
column.
|
DbForeignKeyConstraint |
references(String name,
String referencedTableName)
Creates and adds foreign key constraint with the given parameters to this
column.
|
DbForeignKeyConstraint |
references(String name,
String referencedTableName,
String referencedColName)
Creates and adds foreign key constraint with the given parameters to this
column.
|
DbForeignKeyConstraint |
references(String name,
String referencedSchemaName,
String referencedTableName,
String referencedColName)
Creates and adds foreign key constraint with the given parameters to this
column.
|
DbColumn |
setDefaultValue(Object defaultValue)
Sets the default value for this column.
|
DbConstraint |
unique()
Creates and adds unique constraint with the given parameters to this
column.
|
DbConstraint |
unique(String name)
Creates and adds unique constraint with the given parameters to this
column.
|
addObjects, checkOwnership, checkOwnership, findObject, getAbsoluteName, getName, getParent, getSpec, toStringpublic DbTable getTable()
public String getColumnNameSQL()
getColumnNameSQL in interface Columnpublic String getTypeNameSQL()
getTypeNameSQL in interface Columnpublic Integer getTypeLength()
getTypeLength in interface Columnnullpublic List<Object> getTypeQualifiers()
getTypeQualifiers in interface Columnnull or
empty if none.public List<DbConstraint> getConstraints()
getConstraints in interface Columnpublic DbColumn setDefaultValue(Object defaultValue)
null will
be treated as no default value.public Object getDefaultValue()
getDefaultValue in interface Columnpublic DbConstraint notNull()
Note, no effort is made to make sure the given name is unique.
public DbConstraint notNull(String name)
Note, no effort is made to make sure the given name is unique.
name - the name of the new constraintpublic DbConstraint unique()
Note, no effort is made to make sure the given name is unique.
public DbConstraint unique(String name)
Note, no effort is made to make sure the given name is unique.
name - the name of the new constraintpublic DbConstraint primaryKey()
Note, no effort is made to make sure the given name is unique.
public DbConstraint primaryKey(String name)
Note, no effort is made to make sure the given name is unique.
name - the name of the new constraintpublic DbForeignKeyConstraint references(String referencedTableName)
Note, no effort is made to make sure the given name is unique.
referencedTableName - the name of the referenced tablepublic DbForeignKeyConstraint references(String name, String referencedTableName)
Note, no effort is made to make sure the given name is unique.
name - the name of the new constraintreferencedTableName - the name of the referenced tablepublic DbForeignKeyConstraint references(String name, String referencedTableName, String referencedColName)
Note, no effort is made to make sure the given name is unique.
name - the name of the new constraintreferencedTableName - the name of the referenced tablereferencedColName - the names of the referenced columnpublic DbForeignKeyConstraint references(String name, String referencedSchemaName, String referencedTableName, String referencedColName)
Note, no effort is made to make sure the given name is unique.
name - the name of the new constraintreferencedSchemaName - the name of the referenced schemareferencedTableName - the name of the referenced tablereferencedColName - the names of the referenced columnpublic DbForeignKeyConstraint references(String name, DbTable referencedTable, DbColumn referencedColumn)
Note, no effort is made to make sure the given name is unique.
name - the name of the new constraintreferencedTable - the referenced tablereferencedColumn - the referenced columnpublic DbCheckConstraint checkCondition(String name, Condition condition)
Note, no effort is made to make sure the given name is unique.
condition - the check conditionpublic <T extends DbConstraint> T addConstraint(T constraint)
Note, no effort is made to make sure the given constraint is unique.
constraint - the constraint to be addedCopyright © 2006–2026 OpenHMS. All rights reserved.