|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.h2.table.Column
public class Column
This class represents a column in a table.
Field Summary | |
---|---|
static int |
NOT_NULLABLE
This column is not nullable. |
static int |
NULLABLE
This column is nullable. |
static int |
NULLABLE_UNKNOWN
It is not know whether this column is nullable. |
Constructor Summary | |
---|---|
Column(java.lang.String name,
int type)
|
|
Column(java.lang.String name,
int type,
long precision,
int scale,
int displaySize)
|
Method Summary | |
---|---|
void |
addCheckConstraint(Session session,
Expression expr)
Add a check constraint expression to this column. |
Value |
convert(Value v)
Convert a value to this column's type. |
void |
convertAutoIncrementToSequence(Session session,
Schema schema,
int id,
boolean temporary)
Convert the auto-increment flag to a sequence that is linked with this table. |
boolean |
equals(java.lang.Object o)
|
Expression |
getCheckConstraint(Session session,
java.lang.String asColumnName)
Get the check constraint expression for this column if set. |
Column |
getClone()
|
int |
getColumnId()
|
java.lang.String |
getComment()
|
java.lang.String |
getCreateSQL()
|
Expression |
getDefaultExpression()
|
int |
getDisplaySize()
|
java.lang.String |
getName()
|
java.lang.String |
getOriginalSQL()
|
long |
getPrecision()
|
int |
getScale()
|
int |
getSelectivity()
Get the selectivity of the column. |
Sequence |
getSequence()
|
java.lang.String |
getSQL()
|
Table |
getTable()
|
int |
getType()
|
int |
hashCode()
|
boolean |
isAutoIncrement()
|
boolean |
isNullable()
|
boolean |
isPrimaryKey()
|
void |
prepareExpression(Session session)
Prepare all expressions of this column. |
void |
rename(java.lang.String newName)
Rename the column. |
void |
setAutoIncrement(boolean autoInc,
long start,
long increment)
Set the autoincrement flag and related properties of this column. |
void |
setComment(java.lang.String comment)
|
void |
setComputedExpression(Expression expression)
Set the default value in the form of a computed expression of other columns. |
void |
setConvertNullToDefault(boolean convert)
|
void |
setDefaultExpression(Session session,
Expression defaultExpression)
Set the default expression. |
void |
setNullable(boolean b)
|
void |
setOriginalSQL(java.lang.String original)
|
void |
setPrimaryKey(boolean primaryKey)
|
void |
setSelectivity(int selectivity)
Set the new selectivity of a column. |
void |
setSequence(Sequence sequence)
|
void |
setTable(Table table,
int columnId)
Set the table and column id. |
java.lang.String |
toString()
|
Value |
validateConvertUpdateSequence(Session session,
Value value)
Validate the value, convert it if required, and update the sequence value if required. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int NOT_NULLABLE
public static final int NULLABLE
public static final int NULLABLE_UNKNOWN
Constructor Detail |
---|
public Column(java.lang.String name, int type)
public Column(java.lang.String name, int type, long precision, int scale, int displaySize)
Method Detail |
---|
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public Column getClone()
public Value convert(Value v)
v
- the value
public void setComputedExpression(Expression expression)
expression
- the computed expressionpublic void setTable(Table table, int columnId)
table
- the tablecolumnId
- the column indexpublic Table getTable()
public void setDefaultExpression(Session session, Expression defaultExpression)
session
- the sessiondefaultExpression
- the default expressionpublic int getColumnId()
public java.lang.String getSQL()
public java.lang.String getName()
public int getType()
public long getPrecision()
public int getDisplaySize()
public int getScale()
public void setNullable(boolean b)
public Value validateConvertUpdateSequence(Session session, Value value)
session
- the sessionvalue
- the value or null
public void convertAutoIncrementToSequence(Session session, Schema schema, int id, boolean temporary)
session
- the sessionschema
- the schema where the sequence should be generatedid
- the object idtemporary
- true if the sequence is temporary and does not need to
be storedpublic void prepareExpression(Session session)
session
- the sessionpublic java.lang.String getCreateSQL()
public boolean isNullable()
public void setOriginalSQL(java.lang.String original)
public java.lang.String getOriginalSQL()
public Expression getDefaultExpression()
public boolean isAutoIncrement()
public void setAutoIncrement(boolean autoInc, long start, long increment)
autoInc
- the new autoincrement flagstart
- the sequence start valueincrement
- the sequence incrementpublic void setConvertNullToDefault(boolean convert)
public void rename(java.lang.String newName)
newName
- the new column namepublic void setSequence(Sequence sequence)
public Sequence getSequence()
public int getSelectivity()
public void setSelectivity(int selectivity)
selectivity
- the new valuepublic void addCheckConstraint(Session session, Expression expr)
session
- the sessionexpr
- the (additional) constraintpublic Expression getCheckConstraint(Session session, java.lang.String asColumnName)
session
- the sessionasColumnName
- the column name to use
public void setComment(java.lang.String comment)
public java.lang.String getComment()
public void setPrimaryKey(boolean primaryKey)
public boolean isPrimaryKey()
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |