net.jot.db
Class JOTDBField

java.lang.Object
  extended by net.jot.db.JOTDBField

public class JOTDBField
extends java.lang.Object

Represents a Database Field(column).

Author:
tcolar

Field Summary
static java.lang.String TYPE_BIGINT
           
static java.lang.String TYPE_BIT
           
static java.lang.String TYPE_DATE
           
static java.lang.String TYPE_DECIMAL
           
static java.lang.String TYPE_DOUBLE
           
static java.lang.String TYPE_FLOAT
           
static java.lang.String TYPE_INTEGER
           
static java.lang.String TYPE_SMALLINT
           
static java.lang.String TYPE_TIME
           
static java.lang.String TYPE_TIMESTAMP
           
static java.lang.String TYPE_TINYINT
           
static java.lang.String TYPE_VARCHAR
           
static java.util.Hashtable types
           
 
Constructor Summary
JOTDBField(java.lang.String fieldType)
           
JOTDBField(java.lang.String fieldType, java.lang.String fieldName)
           
 
Method Summary
 void debug()
          Prints field informations to logger, for debugging purposes
 java.lang.String getDefaultValue()
           
 java.lang.String getFieldName()
           
 java.lang.String getFieldType()
           
 int getMaxLength()
           
 int getMaxValue()
           
 int getMinLength()
           
 int getMinValue()
           
 int getSize()
          Returns the field size/length
static java.util.Hashtable getTypes()
          Hashtable of all defined field types
 void setDefaultValue(java.lang.String defaultValue)
          Default value for when the field (database default value)
 void setFieldName(java.lang.String fieldName)
           
 void setFieldType(java.lang.String fieldType)
           
 void setMaxLength(int maxLength)
           
 void setMaxValue(int maxValue)
           
 void setMinLength(int minLength)
           
 void setMinValue(int minValue)
           
 void setSize(int size)
          Sets the field size/length
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

types

public static java.util.Hashtable types

TYPE_VARCHAR

public static final java.lang.String TYPE_VARCHAR
See Also:
Constant Field Values

TYPE_DECIMAL

public static final java.lang.String TYPE_DECIMAL
See Also:
Constant Field Values

TYPE_BIT

public static final java.lang.String TYPE_BIT
See Also:
Constant Field Values

TYPE_TINYINT

public static final java.lang.String TYPE_TINYINT
See Also:
Constant Field Values

TYPE_SMALLINT

public static final java.lang.String TYPE_SMALLINT
See Also:
Constant Field Values

TYPE_INTEGER

public static final java.lang.String TYPE_INTEGER
See Also:
Constant Field Values

TYPE_BIGINT

public static final java.lang.String TYPE_BIGINT
See Also:
Constant Field Values

TYPE_FLOAT

public static final java.lang.String TYPE_FLOAT
See Also:
Constant Field Values

TYPE_DOUBLE

public static final java.lang.String TYPE_DOUBLE
See Also:
Constant Field Values

TYPE_TIMESTAMP

public static final java.lang.String TYPE_TIMESTAMP
See Also:
Constant Field Values

TYPE_DATE

public static final java.lang.String TYPE_DATE
See Also:
Constant Field Values

TYPE_TIME

public static final java.lang.String TYPE_TIME
See Also:
Constant Field Values
Constructor Detail

JOTDBField

public JOTDBField(java.lang.String fieldType)

JOTDBField

public JOTDBField(java.lang.String fieldType,
                  java.lang.String fieldName)
Method Detail

getSize

public int getSize()
Returns the field size/length

Returns:

getTypes

public static java.util.Hashtable getTypes()
Hashtable of all defined field types

Returns:

setDefaultValue

public void setDefaultValue(java.lang.String defaultValue)
Default value for when the field (database default value)

Parameters:
defaultValue -

setSize

public void setSize(int size)
Sets the field size/length

Parameters:
size -

getFieldName

public java.lang.String getFieldName()

setFieldName

public void setFieldName(java.lang.String fieldName)

getFieldType

public java.lang.String getFieldType()

setFieldType

public void setFieldType(java.lang.String fieldType)

getMaxLength

public int getMaxLength()

setMaxLength

public void setMaxLength(int maxLength)

getMaxValue

public int getMaxValue()

setMaxValue

public void setMaxValue(int maxValue)

getMinLength

public int getMinLength()

setMinLength

public void setMinLength(int minLength)

getMinValue

public int getMinValue()

setMinValue

public void setMinValue(int minValue)

debug

public void debug()
Prints field informations to logger, for debugging purposes


getDefaultValue

public java.lang.String getDefaultValue()