Package com.mckoi.database
Class DataTableColumnDef
java.lang.Object
com.mckoi.database.DataTableColumnDef
All the information regarding a column in a table.
- Author:
- Tobias Downer
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionConstructs the column definition.DataTableColumnDef
(DataTableColumnDef column_def) Creates a copy of the given column definition. -
Method Summary
Modifier and TypeMethodDescriptionReturns the Class of Java object that represents this column.columnDescriptionValue
(String column_name) Returns this column as a ColumnDescription object and gives the column description the given name.static DataTableColumnDef
createBinaryColumn
(String name) Convenience helper - creates a DataTableColumnDef that holds a binary value.static DataTableColumnDef
createBooleanColumn
(String name) Convenience helper - creates a DataTableColumnDef that holds a boolean value.static DataTableColumnDef
createNumericColumn
(String name) Convenience helper - creates a DataTableColumnDef that holds a numeric value.static DataTableColumnDef
createStringColumn
(String name) Convenience helper - creates a DataTableColumnDef that holds a string value.void
dump
(PrintStream out) Dumps information about this object to the PrintStream.If this column represents a Java Object, this returns the name of the class the objects stored in the column must be derived from.If this column represents a Java Object, this returns the class object that is the constraining class for the column.int
Returns the type as a String.int
Deprecated.Returns the name of the scheme we use to index this column.getName()
int
getScale()
int
getSize()
int
Returns the type as a String.int
getTType()
Returns the TType for this column.void
Initializes the TType information for a column.boolean
Returns true if this type of column is able to be indexed.boolean
void
setClassConstraint
(String class_constraint) If this column represents a Java object, this must be a class the object is derived from to be added to this column.void
setDBType
(int db_type) void
setDefaultExpression
(Expression expression) void
setForeignKey
(String foreign_key) Deprecated.void
setFromTType
(TType type) Sets this DataTableColumnDef object up from information in the TType object.void
setIndexScheme
(String index_scheme) Sets the indexing scheme for this column.void
void
setNotNull
(boolean status) void
setScale
(int scale) void
setSize
(int size) void
setSQLType
(int sql_type) void
setStringLocale
(String locale_str, int strength, int decomposition) static String
sqlTypeToString
(int sql_type) Returns a string that represents the given SQLType enumeration passed to it.
-
Field Details
-
type
The TType object for this column.
-
-
Constructor Details
-
DataTableColumnDef
public DataTableColumnDef()Constructs the column definition. -
DataTableColumnDef
Creates a copy of the given column definition.
-
-
Method Details
-
setName
-
setNotNull
public void setNotNull(boolean status) -
setSQLType
public void setSQLType(int sql_type) -
setDBType
public void setDBType(int db_type) -
setSize
public void setSize(int size) -
setScale
public void setScale(int scale) -
setStringLocale
-
setDefaultExpression
-
setForeignKey
Deprecated. -
setIndexScheme
Sets the indexing scheme for this column. Either 'InsertSearch' or 'BlindSearch'. If not set, then default to insert search. -
setClassConstraint
If this column represents a Java object, this must be a class the object is derived from to be added to this column. -
setFromTType
Sets this DataTableColumnDef object up from information in the TType object. This is useful when we need to create a DataTableColumnDef object to store information based on nothing more than a TType object. This comes in useful for purely functional tables. -
initTTypeInfo
public void initTTypeInfo()Initializes the TType information for a column. This should be called at the last part of a DataTableColumnDef setup. -
getName
-
isNotNull
public boolean isNotNull() -
getSQLType
public int getSQLType() -
getSQLTypeString
Returns the type as a String. -
getDBTypeString
Returns the type as a String. -
classType
Returns the Class of Java object that represents this column. -
getDBType
public int getDBType() -
getSize
public int getSize() -
getScale
public int getScale() -
getLocaleString
-
getStrength
public int getStrength() -
getDecomposition
public int getDecomposition() -
getDefaultExpression
-
getDefaultExpressionString
-
getForeignKey
Deprecated. -
getIndexScheme
Returns the name of the scheme we use to index this column. It will be either 'InsertSearch' or 'BlindSearch'. -
isIndexableType
public boolean isIndexableType()Returns true if this type of column is able to be indexed. -
getClassConstraint
If this column represents a Java Object, this returns the name of the class the objects stored in the column must be derived from. -
getClassConstraintAsClass
If this column represents a Java Object, this returns the class object that is the constraining class for the column. -
getTType
Returns the TType for this column. -
columnDescriptionValue
Returns this column as a ColumnDescription object and gives the column description the given name. -
dump
Dumps information about this object to the PrintStream. -
sqlTypeToString
Returns a string that represents the given SQLType enumeration passed to it. For example, pass SQLTypes.BIT and it returns the string "BIT" -
createNumericColumn
Convenience helper - creates a DataTableColumnDef that holds a numeric value. -
createBooleanColumn
Convenience helper - creates a DataTableColumnDef that holds a boolean value. -
createStringColumn
Convenience helper - creates a DataTableColumnDef that holds a string value. -
createBinaryColumn
Convenience helper - creates a DataTableColumnDef that holds a binary value.
-