|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.github.drinkjava2.jdialects.model.ColumnModel
public class ColumnModel
A ColumnModel definition represents a platform dependent column in a Database Table, from 1.0.5 this class name changed from "Column" to "ColumnModel" to avoid naming conflict to JPA's "@Column" annotation
| Constructor Summary | |
|---|---|
ColumnModel(String columnName)
|
|
| Method Summary | |
|---|---|
ColumnModel |
autoId()
Bind column to a global Auto Id generator, can be Sequence or a Table |
ColumnModel |
BIGDECIMAL(Integer precision,
Integer scale)
|
ColumnModel |
BIGINT()
|
ColumnModel |
BINARY(Integer... lengths)
|
ColumnModel |
BIT()
|
ColumnModel |
BLOB(Integer... lengths)
|
ColumnModel |
BOOLEAN()
|
ColumnModel |
CHAR(Integer... lengths)
|
ColumnModel |
check(String check)
Add a column check DDL piece if support |
void |
checkReadOnly()
|
ColumnModel |
CLOB(Integer... lengths)
|
ColumnModel |
comment(String comment)
Add comments at end of column definition DDL |
ColumnModel |
DATE()
|
ColumnModel |
DECIMAL(Integer... lengths)
|
ColumnModel |
defaultValue(String value)
Default value for column's definition DDL |
ColumnModel |
DOUBLE()
|
ColumnModel |
entityField(String entityFieldName)
Mark this column map to a Java entity field, if exist other columns map to this field, delete other columns. |
ColumnModel |
FLOAT(Integer... lengths)
|
String |
getCheck()
|
String |
getColumnName()
|
Type |
getColumnType()
|
String |
getComment()
|
String |
getDebugInfo()
|
String |
getDefaultValue()
|
String |
getEntityField()
|
GenerationType |
getIdGenerationType()
|
IdGenerator |
getIdGenerator()
|
String |
getIdGeneratorName()
|
Boolean |
getInsertable()
|
Integer |
getLength()
|
Integer[] |
getLengths()
|
Boolean |
getNullable()
|
Boolean |
getPkey()
|
Integer |
getPrecision()
|
Integer |
getScale()
|
String[] |
getShardDatabase()
|
String[] |
getShardTable()
|
TableModel |
getTableModel()
|
String |
getTail()
|
Boolean |
getTransientable()
|
Boolean |
getUpdatable()
|
ColumnModel |
id()
equal to pkey method. |
ColumnModel |
identityId()
Mark a field will use database's native identity type. |
ColumnModel |
idGenerator(String idGeneratorName)
The value of this column will be generated by a sequence or table generator |
ColumnModel |
insertable(Boolean insertable)
Mark a field insertable=true, only for JPA or ORM tool use |
ColumnModel |
INTEGER()
|
ColumnModel |
JAVA_OBJECT()
|
ColumnModel |
LONG()
|
ColumnModel |
LONGNVARCHAR(Integer length)
|
ColumnModel |
LONGVARBINARY(Integer... lengths)
|
ColumnModel |
LONGVARCHAR(Integer... lengths)
|
ColumnModel |
NCHAR(Integer length)
|
ColumnModel |
NCLOB()
|
ColumnModel |
newCopy()
|
ColumnModel |
notNull()
Add a not null DDL piece if support |
ColumnModel |
NUMERIC(Integer... lengths)
|
ColumnModel |
NVARCHAR(Integer length)
|
ColumnModel |
OTHER(Integer... lengths)
|
ColumnModel |
pkey()
Mark primary key, if more than one will build compound Primary key |
ColumnModel |
REAL()
|
ColumnModel |
sequenceGenerator(String name,
String sequenceName,
Integer initialValue,
Integer allocationSize)
The value of this column will be generated by a sequence |
void |
setCheck(String check)
|
void |
setColumnName(String columnName)
|
void |
setColumnType(Type columnType)
|
void |
setComment(String comment)
|
void |
setDefaultValue(String defaultValue)
|
void |
setEntityField(String entityField)
|
void |
setIdGenerationType(GenerationType idGenerationType)
|
void |
setIdGeneratorName(String idGeneratorName)
|
void |
setInsertable(Boolean insertable)
|
void |
setLength(Integer length)
|
void |
setLengths(Integer[] lengths)
|
void |
setNullable(Boolean nullable)
|
void |
setPkey(Boolean pkey)
|
void |
setPrecision(Integer precision)
|
void |
setScale(Integer scale)
|
void |
setShardDatabase(String[] shardDatabase)
|
void |
setShardTable(String[] shardTable)
|
void |
setTableModel(TableModel tableModel)
|
void |
setTail(String tail)
|
void |
setTransientable(Boolean transientable)
|
void |
setUpdatable(Boolean updatable)
|
ColumnModel |
shardDatabase(String... shardDatabase)
Mark is a shartDatabase column, for ORM tool use |
ColumnModel |
shardTable(String... shardTable)
Mark is a shartTable column, for ORM tool use |
ColumnModel |
SHORT()
|
FKeyModel |
singleFKey(String... refTableAndColumns)
A shortcut method to add Foreign constraint for single column, for multiple columns please use tableModel.fkey() method instead |
ColumnModel |
singleIndex()
A shortcut method to add a index for single column, for multiple columns index please use tableModel.index() method |
ColumnModel |
singleIndex(String indexName)
A shortcut method to add a index for single column, for multiple columns index please use tableModel.index() method |
ColumnModel |
singleUnique()
A shortcut method to add a unique constraint for single column, for multiple columns index please use tableModel.unique() method |
ColumnModel |
singleUnique(String uniqueName)
A shortcut method to add a unique constraint for single column, for multiple columns index please use tableModel.unique() method |
ColumnModel |
SMALLINT()
|
ColumnModel |
snowflake()
|
ColumnModel |
sortedUUID(String name,
Integer sortedLength,
Integer uuidLength)
|
ColumnModel |
STRING(Integer length)
|
ColumnModel |
tableGenerator(String name,
String tableName,
String pkColumnName,
String valueColumnName,
String pkColumnValue,
Integer initialValue,
Integer allocationSize)
|
ColumnModel |
tail(String tail)
Put an extra tail String manually at the end of column definition DDL |
ColumnModel |
TIME()
|
ColumnModel |
TIMESTAMP()
|
ColumnModel |
timeStampId()
|
ColumnModel |
TINYINT()
|
ColumnModel |
updatable(Boolean updatable)
Mark a field updatable=true, only for JPA or ORM tool use |
ColumnModel |
uuid25()
|
ColumnModel |
uuid32()
|
ColumnModel |
uuid36()
|
ColumnModel |
uuidAny(String name,
Integer length)
|
ColumnModel |
VARBINARY(Integer... lengths)
|
ColumnModel |
VARCHAR(Integer length)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ColumnModel(String columnName)
| Method Detail |
|---|
public ColumnModel notNull()
public ColumnModel check(String check)
public ColumnModel newCopy()
public ColumnModel singleIndex(String indexName)
public ColumnModel singleIndex()
public ColumnModel singleUnique(String uniqueName)
public ColumnModel singleUnique()
public ColumnModel defaultValue(String value)
public ColumnModel comment(String comment)
public ColumnModel pkey()
public ColumnModel shardTable(String... shardTable)
public ColumnModel shardDatabase(String... shardDatabase)
public ColumnModel id()
public FKeyModel singleFKey(String... refTableAndColumns)
public IdGenerator getIdGenerator()
public ColumnModel identityId()
public ColumnModel uuid25()
public ColumnModel uuid32()
public ColumnModel uuid36()
public ColumnModel snowflake()
public ColumnModel uuidAny(String name,
Integer length)
public ColumnModel timeStampId()
public ColumnModel autoId()
public ColumnModel sortedUUID(String name,
Integer sortedLength,
Integer uuidLength)
public ColumnModel sequenceGenerator(String name,
String sequenceName,
Integer initialValue,
Integer allocationSize)
public ColumnModel idGenerator(String idGeneratorName)
public ColumnModel tableGenerator(String name,
String tableName,
String pkColumnName,
String valueColumnName,
String pkColumnValue,
Integer initialValue,
Integer allocationSize)
public ColumnModel tail(String tail)
public ColumnModel entityField(String entityFieldName)
public ColumnModel insertable(Boolean insertable)
public ColumnModel updatable(Boolean updatable)
public String getDebugInfo()
public void checkReadOnly()
public ColumnModel LONG()
public ColumnModel BOOLEAN()
public ColumnModel DOUBLE()
public ColumnModel FLOAT(Integer... lengths)
public ColumnModel INTEGER()
public ColumnModel SHORT()
public ColumnModel BIGDECIMAL(Integer precision,
Integer scale)
public ColumnModel STRING(Integer length)
public ColumnModel DATE()
public ColumnModel TIME()
public ColumnModel TIMESTAMP()
public ColumnModel BIGINT()
public ColumnModel BINARY(Integer... lengths)
public ColumnModel BIT()
public ColumnModel BLOB(Integer... lengths)
public ColumnModel CHAR(Integer... lengths)
public ColumnModel CLOB(Integer... lengths)
public ColumnModel DECIMAL(Integer... lengths)
public ColumnModel JAVA_OBJECT()
public ColumnModel LONGNVARCHAR(Integer length)
public ColumnModel LONGVARBINARY(Integer... lengths)
public ColumnModel LONGVARCHAR(Integer... lengths)
public ColumnModel NCHAR(Integer length)
public ColumnModel NCLOB()
public ColumnModel NUMERIC(Integer... lengths)
public ColumnModel NVARCHAR(Integer length)
public ColumnModel OTHER(Integer... lengths)
public ColumnModel REAL()
public ColumnModel SMALLINT()
public ColumnModel TINYINT()
public ColumnModel VARBINARY(Integer... lengths)
public ColumnModel VARCHAR(Integer length)
public String getColumnName()
public void setColumnName(String columnName)
public TableModel getTableModel()
public void setTableModel(TableModel tableModel)
public Type getColumnType()
public void setColumnType(Type columnType)
public Boolean getPkey()
public void setPkey(Boolean pkey)
public Boolean getNullable()
public void setNullable(Boolean nullable)
public String getCheck()
public void setCheck(String check)
public String getDefaultValue()
public void setDefaultValue(String defaultValue)
public GenerationType getIdGenerationType()
public void setIdGenerationType(GenerationType idGenerationType)
public String getIdGeneratorName()
public void setIdGeneratorName(String idGeneratorName)
public String getTail()
public void setTail(String tail)
public String getComment()
public void setComment(String comment)
public Integer[] getLengths()
public void setLengths(Integer[] lengths)
public String getEntityField()
public void setEntityField(String entityField)
public Integer getLength()
public void setLength(Integer length)
public Integer getPrecision()
public void setPrecision(Integer precision)
public Integer getScale()
public void setScale(Integer scale)
public Boolean getInsertable()
public void setInsertable(Boolean insertable)
public Boolean getUpdatable()
public void setUpdatable(Boolean updatable)
public Boolean getTransientable()
public void setTransientable(Boolean transientable)
public String[] getShardTable()
public void setShardTable(String[] shardTable)
public String[] getShardDatabase()
public void setShardDatabase(String[] shardDatabase)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||