|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.fesenmeyer.dbnormalizer.core.AbstractDBItem
de.fesenmeyer.dbnormalizer.core.TableColumn
public class TableColumn
Represents a column of a table in a DB. Contains
most of the common properties which can be retrieved
by means of the JDBC-Interface DatabaseMetaData
.
DatabaseMetaData
Field Summary | |
---|---|
private int |
columnSize
The column size, e.g. |
private int |
dataType
The data type (database-independent int representation). |
private int |
decimalDigits
The decimal digits, e.g. for the column someNumber NUMBER(9,2) the
decimal digits value is 2 . |
private String |
defaultValue
The default value. |
private boolean |
nullable
A Flag specifying whether the column can be null or not, defaults to true . |
private String |
typeName
The typeName (database specific), e.g. |
Constructor Summary | |
---|---|
TableColumn()
|
Method Summary | |
---|---|
int |
compareTo(TableColumn col)
Compares this column to another column based on their names. |
TableColumn |
copy()
Creates a copy of this TableColumn. |
boolean |
equals(Object o)
Overridden Method, tests if this column is equal to the o argument based on the name. |
int |
getColumnSize()
Gets the column size. |
int |
getDataType()
Gets the data type. |
int |
getDecimalDigits()
Gets the decimal digits. |
String |
getDefaultValue()
Gets the default value. |
String |
getTypeName()
Gets the typeName. |
int |
hashCode()
Overridden method, returns a hash code based on the column's name. |
boolean |
isNullable()
Gets whether the column can be null or not. |
void |
setColumnSize(int columnSize)
Sets the column size. |
void |
setDataType(int dataType)
Sets the data type. |
void |
setDecimalDigits(int decimalDigits)
Sets the decimal digits |
void |
setDefaultValue(String defaultValue)
Sets the default value. |
void |
setNullable(boolean nullable)
Sets whether the column can be null or not. |
void |
setTypeName(String type)
Sets the typeName. |
Methods inherited from class de.fesenmeyer.dbnormalizer.core.AbstractDBItem |
---|
getName, setName, toString |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private String typeName
private boolean nullable
true
.
private int dataType
private int decimalDigits
someNumber NUMBER(9,2)
the
decimal digits value is 2
.
private int columnSize
someNumber NUMBER(9,2)
the column size is 9
.
someText VARCHAR(30)
the column size is 30
decimalDigits
private String defaultValue
Constructor Detail |
---|
public TableColumn()
Method Detail |
---|
public int getDecimalDigits()
public void setDecimalDigits(int decimalDigits)
decimalDigits
- the decimal digitspublic int getColumnSize()
public void setColumnSize(int columnSize)
columnSize
- the column sizepublic String getDefaultValue()
public void setDefaultValue(String defaultValue)
defaultValue
- the default valuepublic String getTypeName()
public void setTypeName(String type)
type
- the typeNamepublic boolean isNullable()
true
, if the table can be null;
false
, otherwisepublic void setNullable(boolean nullable)
nullable
- true
, if the table can be null;
false
, otherwisepublic void setDataType(int dataType)
dataType
- the data typepublic int getDataType()
public int compareTo(TableColumn col)
compareTo
in interface Comparable<TableColumn>
col
- another TableColumnpublic TableColumn copy()
public boolean equals(Object o)
equals
in class Object
o
- the Object to test if it is equal to this table
AbstractDBItem.getName()
method returns equal values for both this TableColumn and the TableColumn
specified by the o argument;
false, otherwisepublic int hashCode()
hashCode
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |