net.sf.saffron.sql.type
Class SqlTypeName

java.lang.Object
  |
  +--net.sf.saffron.util.EnumeratedValues.BasicValue
        |
        +--net.sf.saffron.sql.type.SqlTypeName
All Implemented Interfaces:
EnumeratedValues.Value

public class SqlTypeName
extends EnumeratedValues.BasicValue

Enumeration of the type names which can be used to construct a SQL type.

Since:
Nov 24, 2003
Version:
$Id: $
Author:
jhyde

Field Summary
static SqlTypeName Boolean
           
static int Boolean_ordinal
           
static SqlTypeName Date
           
static int Date_ordinal
           
static EnumeratedValues enumeration
          List of all allowable SqlTypeName values.
static SqlTypeName Integer
           
static int Integer_ordinal
           
static SqlTypeName Null
           
static int Null_ordinal
           
private static int PrecNoScaleNo
           
private static int PrecYesScaleNo
           
private static int PrecYesScaleYes
           
private  int signatures
          Bitwise-or of flags indicating allowable precision/scale combinations.
static SqlTypeName Time
           
static int Time_ordinal
           
static SqlTypeName Timestamp
           
static int Timestamp_ordinal
           
static SqlTypeName Varchar
           
static int Varchar_ordinal
           
 
Fields inherited from class net.sf.saffron.util.EnumeratedValues.BasicValue
description_, name_, ordinal_
 
Constructor Summary
private SqlTypeName(String name, int ordinal, int signatures)
           
 
Method Summary
 boolean allowsNoPrecNoScale()
           
 boolean allowsPrecNoScale()
           
 boolean allowsPrecScale(boolean precision, boolean scale)
          Returns whether this type can be specified with a given combination of precision and scale.
static SqlTypeName get(int ordinal)
          Looks up a type name from its ordinal.
static SqlTypeName get(String name)
          Looks up a type name from its name.
 
Methods inherited from class net.sf.saffron.util.EnumeratedValues.BasicValue
equals, getDescription, getName, getOrdinal, toString, unexpected
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

signatures

private final int signatures
Bitwise-or of flags indicating allowable precision/scale combinations.


PrecNoScaleNo

private static final int PrecNoScaleNo
See Also:
Constant Field Values

PrecYesScaleNo

private static final int PrecYesScaleNo
See Also:
Constant Field Values

PrecYesScaleYes

private static final int PrecYesScaleYes
See Also:
Constant Field Values

Boolean_ordinal

public static final int Boolean_ordinal
See Also:
Constant Field Values

Boolean

public static final SqlTypeName Boolean

Integer_ordinal

public static final int Integer_ordinal
See Also:
Constant Field Values

Integer

public static final SqlTypeName Integer

Varchar_ordinal

public static final int Varchar_ordinal
See Also:
Constant Field Values

Varchar

public static final SqlTypeName Varchar

Date_ordinal

public static final int Date_ordinal
See Also:
Constant Field Values

Date

public static final SqlTypeName Date

Time_ordinal

public static final int Time_ordinal
See Also:
Constant Field Values

Time

public static final SqlTypeName Time

Timestamp_ordinal

public static final int Timestamp_ordinal
See Also:
Constant Field Values

Timestamp

public static final SqlTypeName Timestamp

Null_ordinal

public static final int Null_ordinal
See Also:
Constant Field Values

Null

public static final SqlTypeName Null

enumeration

public static final EnumeratedValues enumeration
List of all allowable SqlTypeName values.

Constructor Detail

SqlTypeName

private SqlTypeName(String name,
                    int ordinal,
                    int signatures)
Method Detail

get

public static SqlTypeName get(int ordinal)
Looks up a type name from its ordinal.


get

public static SqlTypeName get(String name)
Looks up a type name from its name.


allowsNoPrecNoScale

public boolean allowsNoPrecNoScale()

allowsPrecNoScale

public boolean allowsPrecNoScale()

allowsPrecScale

public boolean allowsPrecScale(boolean precision,
                               boolean scale)
Returns whether this type can be specified with a given combination of precision and scale. For example,

Parameters:
precision - Whether the precision/length field is part of the type specification
scale - Whether the scale field is part of the type specification
Returns:
Whether this combination of precision/scale is valid

SourceForge.net_Logo