gate.db
Class Field
java.lang.Object
|
+--gate.db.Field
- public class Field
- extends Object
This class is used in defining databases structure.
More precisely, this class defines a column in a database table.
Constructor Summary |
Field(String name,
String type,
int size,
int scale,
boolean notNull,
boolean primaryKey)
Constructs a instance of Field. |
Method Summary |
(package private) static void |
()
|
boolean |
equals(Object obj)
Checks this object for "equality" whith annother object of type Field. |
String |
toString()
Returns a String representation of this object. |
DEBUG
private static final boolean DEBUG
- Debug flag
name
public String name
type
public String type
size
public int size
scale
public int scale
notNull
public boolean notNull
primaryKey
public boolean primaryKey
NUMERIC_TYPES
protected static Collection NUMERIC_TYPES
Field
public Field(String name,
String type,
int size,
int scale,
boolean notNull,
boolean primaryKey)
- Constructs a instance of Field.
- Parameters:
name
- a value of type 'String', the name of the column.type
- a value of type 'String', the SQL type of the column.size
- a value of type 'int', the size (precision) of the
columnscale
- a value of type 'int', the scale (number of decimal places)
of the column.notNull
- a value of type 'boolean', is this column NOT NULLABLE?primaryKey
- a value of type 'boolean', is this column a member
of the primary key?
toString
public String toString()
- Returns a String representation of this object.
- Overrides:
toString
in class Object
- Returns:
- a value of type 'String'
equals
public boolean equals(Object obj)
- Checks this object for "equality" whith annother object of type Field.
NOTE: this is NOT an equality test. This method return true even if the
'size' field of the given object is larger than the 'size' field of this
object. This was necessary because this method is actually used while
testing a database for compliance with a given structure (obviously a
larger size does not stop table from being compliant with the requested
structure).
- Overrides:
equals
in class Object
- Parameters:
obj
- a value of type 'Object'- Returns:
- a value of type 'boolean'
static void ()