|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.brains2b.sql.meta.ColumnModel org.brains2b.squeler.ddl.ColumnDDL
public class ColumnDDL
ColumnDDL defines and writes a column DDL statement that is used in other DDL statements.
Field Summary |
---|
Fields inherited from interface org.brains2b.squeler.ddl.DDLDefinition |
---|
CREATE, DELETE, UPDATE |
Constructor Summary | |
---|---|
ColumnDDL()
Constructor for ColumnDDL. |
|
ColumnDDL(org.brains2b.sql.meta.ColumnModel model)
|
|
ColumnDDL(java.lang.String columnName,
int dataType,
java.lang.String typeName,
int columnSize,
int decimalDigits,
java.lang.String dflt,
boolean nullable)
Constructor for ColumnDDL. |
Method Summary | |
---|---|
int |
getAction()
|
java.lang.StringBuffer |
getStatement()
|
java.lang.StringBuffer |
getStatement(java.lang.String type,
int action)
gets the correct column statement for a DDL type |
java.lang.String |
getTypeName()
Implemented here to return a valid Oracle name on the basis of a data type as defined in java.sql.Types |
boolean |
isDescendingSort()
check if the column should be sorted in desceding order |
boolean |
isNullable()
checks if the column is nullable. |
boolean |
isQualified()
|
boolean |
isReplaceable()
|
void |
setAction(int action)
|
void |
setColumnName(java.lang.String columnName)
sets the name for this column |
void |
setColumnSize(int size)
sets the length of this column |
void |
setDataType(short dataType)
set the data type for this column as defined in java.sql.Types |
void |
setDecimalDigits(int decimals)
sets the number of decimal digits. |
void |
setDescendingSort(boolean descendingSort)
sets the column to be sorted descending |
void |
setModel(org.brains2b.sql.meta.SQLMetaModel model)
|
void |
setNullable(boolean nullable)
sets a flag if this column is nullable |
void |
setTableName(java.lang.String tableName)
sets the table name for this column |
void |
setTypeName(java.lang.String typeName)
set the data type for this column as defined in java.sql.Types |
java.lang.String |
toString()
|
Methods inherited from class org.brains2b.sql.meta.ColumnModel |
---|
equals, getColumnSize, getDataType, getDecimalDigits, getDefault, getName, getRecord, getRemarks, getSequence, getTableName, getType, setRecord |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.brains2b.sql.meta.SQLMetaModel |
---|
getName, getRecord, getType |
Constructor Detail |
---|
public ColumnDDL()
public ColumnDDL(org.brains2b.sql.meta.ColumnModel model)
public ColumnDDL(java.lang.String columnName, int dataType, java.lang.String typeName, int columnSize, int decimalDigits, java.lang.String dflt, boolean nullable)
columnName
- String, the columnName which is off course requireddataType
- int, the datatype of the column. Must be value defined in java.sql.TypescolumnSize
- int, the length of this column, not required for all dataypesdecimalDigits
- int, the number of decimal positions for a number set to 0 if not requireddflt
- String, default valuenullable
- boolean, is this a required field, only used if actually set to falseMethod Detail |
---|
public java.lang.StringBuffer getStatement() throws SquelerDDLException
getStatement
in interface DDLDefinition
SquelerDDLException
DDLWriter.getStatement()
public java.lang.StringBuffer getStatement(java.lang.String type, int action) throws SquelerDDLException
type
- String, the type of object you want to create a column statement for: Use {Object}DDL.TYPE
as parameter
SquelerDDLException,
- thrown if a valid SQL statement cannot be made from the supplied information
SquelerDDLException
public java.lang.String getTypeName()
getTypeName
in class org.brains2b.sql.meta.ColumnModel
ColumnModel.getTypeName()
public void setTableName(java.lang.String tableName)
tableName
- String, the tableNamepublic void setColumnName(java.lang.String columnName)
columnName
- String, the columnNamepublic void setColumnSize(int size)
size
- int, the sizepublic void setDataType(short dataType)
dataType
- short, the datatypepublic void setTypeName(java.lang.String typeName)
typeName
- String, the datatypepublic void setDecimalDigits(int decimals)
set to 0 if datatype is not a number
decimals
- int, the number of decimal positionspublic void setNullable(boolean nullable)
true does not do anything in this respect, while JDBC defines three values for NULLABLE (YES,NO,We don't know)
nullable
- boolean, set to false if this column cannot be NULLpublic boolean isNullable()
Warning:true might mean it is nullable or JDBC just doesn't know
isNullable
in class org.brains2b.sql.meta.ColumnModel
public boolean isDescendingSort()
Only used for IndexDDL, the default is asceding.
public void setDescendingSort(boolean descendingSort)
Only used for IndexDDL, the default is asceding.
descendingSort
- boolean, set to true if you want this column ordered descending.public java.lang.String toString()
toString
in interface DDLDefinition
toString
in class org.brains2b.sql.meta.ColumnModel
public int getAction()
getAction
in interface DDLDefinition
public boolean isQualified()
isQualified
in interface DDLDefinition
public boolean isReplaceable()
isReplaceable
in interface DDLDefinition
public void setAction(int action)
setAction
in interface DDLDefinition
public void setModel(org.brains2b.sql.meta.SQLMetaModel model)
setModel
in interface DDLDefinition
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |