org.enableit.db
Class SqlType

java.lang.Object
  |
  +--org.enableit.db.SqlType
All Implemented Interfaces:
java.io.Serializable

public class SqlType
extends java.lang.Object
implements java.io.Serializable

This class has a primary purpose of representing a null value to be inserted into some SQL call handled by the proxy objects

This is necessary to allow the proxies to receive a null object yet still provide the JDBC driver with a known object type as required by PreparedStatement.setNull

The integer used in the constructor should be one of the static final members of Types

Version:
__VERSION__
Author:
tim@thestephensons.org
See Also:
java.sql.Types
, DatabaseProxy
, GenericDBProxy
, Serialized Form

Field Summary
static java.lang.String ABOUT
          Information on the exact CVS version accessible after compilation
static int BIGDECIMAL
          Represents a BigDecimal
static int BOOLEAN
          Represents a Boolean
static int BYTEARRAY
          Represents a Byte[]
static int CHARACTER
          Represents a Character
static int DATE
          Represents a java.util.Date
static int DOUBLE
          Represents a Double
static int FLOAT
          Represents a Float
static int INTEGER
          Deprecated.  
static int LONG
          Represents a Long
static int SHORT
          Represents a Short
static int SQLDATE
          Represents a SQL Date
static int SQLTIME
          Represents a SQL Time
static int SQLTIMESTAMP
           
static int STRING
          Represents a String
 
Constructor Summary
SqlType(org.enableit.db.beans.Column column)
          Constructs a new instance of this class initialised with the datatype that matches the string in the Column instance most closely.
SqlType(int dataType)
          Constructs a new instance of this class initialised with the integer constant of its type.
SqlType(int dataType, int scale, int precision)
          Constructs a new instance of this class initialised with the integer constant of its type.
 
Method Summary
 int getDataType()
          Returns the datatype that this class represents
 java.lang.String getJavaType()
          Returns the appropriate Java datatype that this class represents
 java.lang.String toString()
          Returns a string name of the datatype represented by this object
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

BOOLEAN

public static final int BOOLEAN
Represents a Boolean

See Also:
Constant Field Values

CHARACTER

public static final int CHARACTER
Represents a Character

See Also:
Constant Field Values

DOUBLE

public static final int DOUBLE
Represents a Double

See Also:
Constant Field Values

FLOAT

public static final int FLOAT
Represents a Float

See Also:
Constant Field Values

INTEGER

public static final int INTEGER
Deprecated.  

Represents an Integer

See Also:
Constant Field Values

LONG

public static final int LONG
Represents a Long

See Also:
Constant Field Values

SHORT

public static final int SHORT
Represents a Short

See Also:
Constant Field Values

STRING

public static final int STRING
Represents a String

See Also:
Constant Field Values

BIGDECIMAL

public static final int BIGDECIMAL
Represents a BigDecimal

See Also:
Constant Field Values

DATE

public static final int DATE
Represents a java.util.Date

See Also:
Constant Field Values

BYTEARRAY

public static final int BYTEARRAY
Represents a Byte[]

See Also:
Constant Field Values

SQLDATE

public static final int SQLDATE
Represents a SQL Date

See Also:
Constant Field Values

SQLTIME

public static final int SQLTIME
Represents a SQL Time

See Also:
Constant Field Values

SQLTIMESTAMP

public static final int SQLTIMESTAMP
See Also:
Constant Field Values

ABOUT

public static final java.lang.String ABOUT
Information on the exact CVS version accessible after compilation

See Also:
Constant Field Values
Constructor Detail

SqlType

public SqlType(int dataType)
Constructs a new instance of this class initialised with the integer constant of its type.

Parameters:
dataType - the int that represents the datatype that this class is being created for.

SqlType

public SqlType(int dataType,
               int scale,
               int precision)
Constructs a new instance of this class initialised with the integer constant of its type.

Parameters:
dataType - the int that represents the datatype that this class is being created for.
scale - The scale of this data type.
precision - The precision of this data type.

SqlType

public SqlType(org.enableit.db.beans.Column column)
Constructs a new instance of this class initialised with the datatype that matches the string in the Column instance most closely.

Parameters:
column - Encapsulates data ABOUT a db column.
Method Detail

toString

public java.lang.String toString()
Returns a string name of the datatype represented by this object

Overrides:
toString in class java.lang.Object

getDataType

public int getDataType()
Returns the datatype that this class represents


getJavaType

public java.lang.String getJavaType()
Returns the appropriate Java datatype that this class represents



Copyright © 1999-2004 enableIT.org. All Rights Reserved.