public class Column extends Object
DatabaseMetaData
.Modifier and Type | Field and Description |
---|---|
static int |
FLAG_DIRECT_INSERT |
static int |
FLAG_DIRECT_UPDATE |
static int |
FLAG_FK_INSERT |
static int |
FLAG_FK_UPDATE |
static int |
FLAG_PK_JOIN |
static int |
FLAG_UNINSERTABLE |
static int |
FLAG_UNUPDATABLE |
Constructor and Description |
---|
Column()
Default constructor.
|
Column(DBIdentifier name,
Table table) |
Column(String name,
Table table)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
addConstraint(Constraint c)
Adds the given constraint to this column.
|
void |
copy(Column from)
Copy information from the given column to this one.
|
void |
deref() |
boolean |
equalsColumn(DBDictionary dict,
Column col)
Tests compatibility.
|
String |
getComment() |
Set<Constraint> |
getConstraints()
Gets all constrains attached this column.
|
<T extends Constraint> |
getConstraints(Class<T> type)
Gets all constrains of the given type attached to this column.
|
int |
getDecimalDigits()
Return the number of decimal digits for the column, if applicable.
|
Object |
getDefault()
Return the default value set for this column, if any.
|
String |
getDefaultString()
Return the default value set for the column, if any.
|
String |
getDescription()
Useful for debugging.
|
boolean |
getFlag(int flag)
Flags are used for bookkeeping information.
|
DBIdentifier |
getFullDBIdentifier() |
String |
getFullName()
Deprecated.
use getFullDBIdentifier()
|
DBIdentifier |
getIdentifier() |
int |
getIndex()
Return the column's 0-based index in the owning table.
|
int |
getJavaType()
The Java type the data in this column is treated as, from
JavaTypes or JavaSQLTypes . |
String |
getName()
Deprecated.
use getIdentifier()
|
QualifiedDBIdentifier |
getQualifiedPath() |
int |
getRefCount() |
DBIdentifier |
getSchemaIdentifier() |
String |
getSchemaName()
Deprecated.
|
int |
getSize()
Return the column's size.
|
Table |
getTable()
Return the table for the column.
|
DBIdentifier |
getTableIdentifier() |
String |
getTableName()
Deprecated.
|
String |
getTarget()
Deprecated.
use getTargetIdentifier()
|
String |
getTargetField()
The name of the field this column joins to, if any.
|
DBIdentifier |
getTargetIdentifier() |
int |
getType()
Return the column's SQL type.
|
DBIdentifier |
getTypeIdentifier() |
String |
getTypeName()
Deprecated.
|
VersionStrategy |
getVersionStrategy() |
boolean |
hasComment() |
boolean |
hasConstraint(Class<? extends Constraint> type)
Affirms if this column has any constraint of given type.
|
boolean |
isAutoAssigned()
Whether this column is auto-assigned a value on insert.
|
boolean |
isCompatible(int type,
String typeName,
int size,
int decimals)
Return true if this column is compatible with the given JDBC type
from
Types and size. |
boolean |
isForeignKey()
Affirms if any foreign key constraint is attached to this column.
|
boolean |
isImplicitRelation()
Affirms if this instance represents an implicit relation.
|
boolean |
isIndex()
Affirms if any index constraint is attached to this column.
|
boolean |
isLob()
Whether this column is a LOB.
|
boolean |
isNotNull()
Return true if this is a NOT NULL column.
|
boolean |
isNotNullExplicit()
Whether the not-null property has been set.
|
boolean |
isPrimaryKey()
Return true if this column belongs to the table's primary key.
|
boolean |
isRelationId()
Whether this column stores some form of serialized identity value for
a related record.
|
boolean |
isUni1MFK()
Sets a marker to indicate that this instance represents a uni-directional
one to many relation using the foreign key strategy.
|
boolean |
isUniqueConstraint()
Affirms if any unique constraint is attached to this column.
|
boolean |
isXML()
Whether this column is of XML type.
|
void |
ref() |
void |
removeConstraint(Constraint c)
Removes the given constraint from this column.
|
void |
resetTableIdentifier(DBIdentifier table) |
void |
resetTableName(String name)
Deprecated.
|
void |
setAutoAssigned(boolean autoAssign)
Whether this column is auto-incrementing.
|
void |
setComment(String comment) |
void |
setDecimalDigits(int digits)
Set the number of decimal digits for the column.
|
void |
setDefault(Object def)
Set the default value for the column.
|
void |
setDefaultString(String def)
Set the default value for the column.
|
void |
setFlag(int flag,
boolean on)
Flags are used for bookkeeping information.
|
void |
setIdentifier(DBIdentifier name) |
void |
setImplicitRelation(boolean flag)
Sets a marker to imply a logical relation that can not have any physical
manifest in the database.
|
void |
setJavaType(int type)
The Java type the data in this column is treated as, from
JavaTypes or JavaSQLTypes . |
void |
setName(String name)
Deprecated.
use setIdentifier(DBIdentifier name)
|
void |
setNotNull(boolean notNull)
Set whether this is a NOT NULL column.
|
void |
setRelationId(boolean rel)
Whether this column stores some form of serialized identity value for
a related record.
|
void |
setSchemaIdentifier(DBIdentifier name) |
void |
setSchemaName(String name)
Deprecated.
use setSchemaIdentifier(DBIdentifier name)
|
void |
setSize(int size)
Set the column's size.
|
void |
setTableIdentifier(DBIdentifier name) |
void |
setTableName(String name)
Deprecated.
|
void |
setTarget(String target)
Deprecated.
use setTargetIdentifier(DBIdentifier target)
|
void |
setTargetField(String target)
The name of the field this column joins to, if any.
|
void |
setTargetIdentifier(DBIdentifier target) |
void |
setType(int sqlType)
Set the column's SQL type.
|
void |
setTypeIdentifier(DBIdentifier typeName) |
void |
setTypeName(String typeName)
Deprecated.
|
void |
setUni1MFK(boolean isUni1MFK)
Affirms if this instance represents a uni-directional one to many relation
using the foreign key strategy.
|
void |
setVersionStrategy(VersionStrategy strategy) |
void |
setXML(boolean xml)
Whether this column is of XML type.
|
String |
toString()
Returns the column name.
|
public static final int FLAG_UNINSERTABLE
public static final int FLAG_UNUPDATABLE
public static final int FLAG_DIRECT_INSERT
public static final int FLAG_DIRECT_UPDATE
public static final int FLAG_FK_INSERT
public static final int FLAG_FK_UPDATE
public static final int FLAG_PK_JOIN
public Column()
public Column(String name, Table table)
name
- the name of the columntable
- the column's tablepublic Column(DBIdentifier name, Table table)
public Table getTable()
public String getTableName()
public DBIdentifier getTableIdentifier()
public void setTableName(String name)
public void setTableIdentifier(DBIdentifier name)
public void resetTableName(String name)
public void resetTableIdentifier(DBIdentifier table)
public String getSchemaName()
public DBIdentifier getSchemaIdentifier()
public void setSchemaName(String name)
public void setSchemaIdentifier(DBIdentifier name)
public String getName()
public DBIdentifier getIdentifier()
public void setName(String name)
public void setIdentifier(DBIdentifier name)
public String getFullName()
public DBIdentifier getFullDBIdentifier()
public QualifiedDBIdentifier getQualifiedPath()
public int getType()
Types
.public void setType(int sqlType)
Types
.public String getTypeName()
public DBIdentifier getTypeIdentifier()
public void setTypeName(String typeName)
public void setTypeIdentifier(DBIdentifier typeName)
public int getJavaType()
JavaTypes
or JavaSQLTypes
.public void setJavaType(int type)
JavaTypes
or JavaSQLTypes
.public int getSize()
public void setSize(int size)
public int getDecimalDigits()
public void setDecimalDigits(int digits)
public String getDefaultString()
public void setDefaultString(String def)
public Object getDefault()
public void setDefault(Object def)
public boolean isNotNull()
public void setNotNull(boolean notNull)
public boolean isNotNullExplicit()
public boolean isAutoAssigned()
public void setAutoAssigned(boolean autoAssign)
public boolean isRelationId()
public void setRelationId(boolean rel)
public String getTarget()
public DBIdentifier getTargetIdentifier()
public void setTarget(String target)
public void setTargetIdentifier(DBIdentifier target)
public String getTargetField()
public void setTargetField(String target)
public boolean getFlag(int flag)
public void setFlag(int flag, boolean on)
public boolean isPrimaryKey()
public int getIndex()
public boolean isLob()
public boolean isCompatible(int type, String typeName, int size, int decimals)
Types
and size.public String getDescription()
public boolean equalsColumn(DBDictionary dict, Column col)
public void copy(Column from)
public boolean isXML()
public void setXML(boolean xml)
public VersionStrategy getVersionStrategy()
public void setVersionStrategy(VersionStrategy strategy)
public boolean hasComment()
public String getComment()
public void setComment(String comment)
public boolean isImplicitRelation()
public void setImplicitRelation(boolean flag)
public boolean isUni1MFK()
public void setUni1MFK(boolean isUni1MFK)
public void addConstraint(Constraint c)
public void removeConstraint(Constraint c)
public boolean hasConstraint(Class<? extends Constraint> type)
public Set<Constraint> getConstraints()
public <T extends Constraint> Set<T> getConstraints(Class<T> type)
public boolean isUniqueConstraint()
public boolean isIndex()
public boolean isForeignKey()
public int getRefCount()
public void ref()
public void deref()
Copyright © 2006–2017 Apache Software Foundation. All rights reserved.