com.akiban.sql.types
Class TypeId

java.lang.Object
  extended by com.akiban.sql.types.TypeId
Direct Known Subclasses:
TypeId.RowMultiSetTypeId

public class TypeId
extends Object

TypeId describes the static information about a SQL type independent of any specific attributes of the type such as length. So the TypeId for CHARACTER describes the fundamental information about CHARACTER. A specific type (e.g. CHARACTER(10)) is described by a TypeDescriptor for a catlog type and a DataTypeDescriptor for a runtime type. (note a DataTypeDescriptor adds runtime attributes to the TypeDescriptor it has).

A TypeId is immutable.

The equals(Object) method can be used to determine if two typeIds are for the same type, which defines type id equality.

See Also:
DataTypeDescriptor

Nested Class Summary
static class TypeId.FormatIds
           
static class TypeId.RowMultiSetTypeId
           
 
Field Summary
static String ARRAY_NAME
           
static TypeId BIGINT_ID
           
static TypeId BIGINT_UNSIGNED_ID
           
static String BINARY_NAME
           
static TypeId BIT_ID
           
static int BIT_MAXWIDTH
           
static String BIT_NAME
           
static int BIT_PRECEDENCE
           
static TypeId BLOB_ID
           
static int BLOB_MAXWIDTH
           
static String BLOB_NAME
           
static int BLOB_PRECEDENCE
           
static TypeId BOOLEAN_ID
           
static int BOOLEAN_MAXWIDTH
           
static String BOOLEAN_NAME
           
static int BOOLEAN_PRECEDENCE
           
static TypeId CHAR_ID
           
static int CHAR_MAXWIDTH
           
static String CHAR_NAME
           
static int CHAR_PRECEDENCE
           
static TypeId CLOB_ID
           
static int CLOB_MAXWIDTH
           
static String CLOB_NAME
           
static int CLOB_PRECEDENCE
           
static String DATALINK_NAME
           
static TypeId DATE_ID
           
static int DATE_MAXWIDTH
           
static String DATE_NAME
           
static int DATE_PRECEDENCE
           
static TypeId DATETIME_ID
           
static String DATETIME_NAME
           
static TypeId DECIMAL_ID
           
static int DECIMAL_MAXWIDTH
           
static String DECIMAL_NAME
           
static int DECIMAL_PRECEDENCE
           
static int DECIMAL_PRECISION
           
static int DECIMAL_SCALE
           
static TypeId DECIMAL_UNSIGNED_ID
           
static String DECIMAL_UNSIGNED_NAME
           
static int DEFAULT_DECIMAL_PRECISION
           
static int DEFAULT_DECIMAL_SCALE
           
static TypeId DOUBLE_ID
           
static int DOUBLE_MAXWIDTH
           
static String DOUBLE_NAME
           
static int DOUBLE_PRECEDENCE
           
static int DOUBLE_PRECISION
           
static int DOUBLE_PRECISION_IN_DIGITS
           
static int DOUBLE_SCALE
           
static TypeId DOUBLE_UNSIGNED_ID
           
static String DOUBLE_UNSIGNED_NAME
           
static String FLOAT_NAME
           
static String FLOAT_UNSIGNED_NAME
           
static int INT_MAXWIDTH
           
static String INT_NAME
           
static int INT_PRECEDENCE
           
static int INT_PRECISION
           
static int INT_SCALE
           
static String INT_UNSIGNED_NAME
           
static TypeId INTEGER_ID
           
static String INTEGER_NAME
           
static TypeId INTEGER_UNSIGNED_ID
           
static String INTEGER_UNSIGNED_NAME
           
static TypeId INTERVAL_DAY_HOUR_ID
           
static String INTERVAL_DAY_HOUR_NAME
           
static TypeId INTERVAL_DAY_ID
           
static TypeId INTERVAL_DAY_MINUTE_ID
           
static String INTERVAL_DAY_MINUTE_NAME
           
static String INTERVAL_DAY_NAME
           
static TypeId INTERVAL_DAY_SECOND_ID
           
static int INTERVAL_DAY_SECOND_MAXWIDTH
           
static String INTERVAL_DAY_SECOND_NAME
           
static int INTERVAL_DAY_SECOND_PRECISION
           
static int INTERVAL_DAY_SECOND_SCALE
           
static TypeId INTERVAL_HOUR_ID
           
static TypeId INTERVAL_HOUR_MINUTE_ID
           
static String INTERVAL_HOUR_MINUTE_NAME
           
static String INTERVAL_HOUR_NAME
           
static TypeId INTERVAL_HOUR_SECOND_ID
           
static String INTERVAL_HOUR_SECOND_NAME
           
static TypeId INTERVAL_MINUTE_ID
           
static String INTERVAL_MINUTE_NAME
           
static TypeId INTERVAL_MINUTE_SECOND_ID
           
static String INTERVAL_MINUTE_SECOND_NAME
           
static TypeId INTERVAL_MONTH_ID
           
static String INTERVAL_MONTH_NAME
           
static int INTERVAL_PRECEDENCE
           
static TypeId INTERVAL_SECOND_ID
           
static String INTERVAL_SECOND_NAME
           
static TypeId INTERVAL_YEAR_ID
           
static TypeId INTERVAL_YEAR_MONTH_ID
           
static int INTERVAL_YEAR_MONTH_MAXWIDTH
           
static String INTERVAL_YEAR_MONTH_NAME
           
static int INTERVAL_YEAR_MONTH_PRECISION
           
static int INTERVAL_YEAR_MONTH_SCALE
           
static String INTERVAL_YEAR_NAME
           
static TypeId LONGBLOB_ID
           
static String LONGBLOB_NAME
           
static int LONGINT_MAXWIDTH
           
static String LONGINT_NAME
           
static int LONGINT_PRECEDENCE
           
static int LONGINT_PRECISION
          Various fixed numbers related to datatypes.
static int LONGINT_SCALE
           
static String LONGINT_UNSIGNED_NAME
           
static TypeId LONGTEXT_ID
           
static String LONGTEXT_NAME
           
static String LONGVARBINARY_NAME
           
static TypeId LONGVARBIT_ID
           
static int LONGVARBIT_MAXWIDTH
           
static String LONGVARBIT_NAME
           
static int LONGVARBIT_PRECEDENCE
           
static TypeId LONGVARCHAR_ID
           
static int LONGVARCHAR_MAXWIDTH
           
static String LONGVARCHAR_NAME
           
static int LONGVARCHAR_PRECEDENCE
           
static TypeId MEDIUMBLOB_ID
           
static String MEDIUMBLOB_NAME
           
static TypeId MEDIUMINT_ID
           
static String MEDIUMINT_NAME
           
static TypeId MEDIUMINT_UNSIGNED_ID
           
static String MEDIUMINT_UNSIGNED_NAME
           
static TypeId MEDIUMTEXT_ID
           
static String MEDIUMTEXT_NAME
           
static String NATIONAL_CHAR_NAME
           
static String NATIONAL_LONGVARCHAR_NAME
           
static String NATIONAL_VARCHAR_NAME
           
static String NCLOB_NAME
           
static TypeId NUMERIC_ID
           
static String NUMERIC_NAME
           
static int NUMERIC_PRECEDENCE
           
static TypeId NUMERIC_UNSIGNED_ID
           
static String NUMERIC_UNSIGNED_NAME
           
static TypeId REAL_ID
           
static int REAL_MAXWIDTH
           
static String REAL_NAME
           
static int REAL_PRECEDENCE
           
static int REAL_PRECISION
           
static int REAL_PRECISION_IN_DIGITS
           
static int REAL_SCALE
           
static TypeId REAL_UNSIGNED_ID
           
static String REAL_UNSIGNED_NAME
           
static TypeId REF_ID
           
static String REF_NAME
           
static int REF_PRECEDENCE
           
static String ROWID_NAME
           
static TypeId SMALLINT_ID
           
static int SMALLINT_MAXWIDTH
           
static String SMALLINT_NAME
           
static int SMALLINT_PRECEDENCE
           
static int SMALLINT_PRECISION
           
static int SMALLINT_SCALE
           
static TypeId SMALLINT_UNSIGNED_ID
           
static String SMALLINT_UNSIGNED_NAME
           
static String SQLXML_NAME
           
static String STRUCT_NAME
           
static TypeId TEXT_ID
           
static String TEXT_NAME
           
static TypeId TIME_ID
           
static int TIME_MAXWIDTH
           
static String TIME_NAME
           
static int TIME_PRECEDENCE
           
static int TIME_SCALE
           
static TypeId TIMESTAMP_ID
           
static int TIMESTAMP_MAXWIDTH
           
static String TIMESTAMP_NAME
           
static int TIMESTAMP_PRECEDENCE
           
static int TIMESTAMP_SCALE
           
static TypeId TINYBLOB_ID
           
static String TINYBLOB_NAME
           
static TypeId TINYINT_ID
           
static int TINYINT_MAXWIDTH
           
static String TINYINT_NAME
           
static int TINYINT_PRECEDENCE
           
static int TINYINT_PRECISION
           
static int TINYINT_SCALE
           
static TypeId TINYINT_UNSIGNED_ID
           
static String TINYINT_UNSIGNED_NAME
           
static TypeId TINYTEXT_ID
           
static String TINYTEXT_NAME
           
static int USER_PRECEDENCE
          The following constants define the type precedence hierarchy.
static String VARBINARY_NAME
           
static TypeId VARBIT_ID
           
static int VARBIT_MAXWIDTH
           
static String VARBIT_NAME
           
static int VARBIT_PRECEDENCE
           
static TypeId VARCHAR_ID
           
static int VARCHAR_MAXWIDTH
           
static String VARCHAR_NAME
           
static int VARCHAR_PRECEDENCE
           
static TypeId XML_ID
           
static int XML_MAXWIDTH
           
static String XML_NAME
           
static int XML_PRECEDENCE
           
static TypeId YEAR_ID
           
static String YEAR_NAME
           
 
Method Summary
 boolean equals(Object that)
          we want equals to say if these are the same type id or not.
static TypeId[] getAllBuiltinTypeIds()
          Return all of the builtin type ids.
static TypeId getBuiltInTypeId(int JDBCTypeId)
          Get a TypeId of the given JDBC type.
static TypeId getBuiltInTypeId(String SQLTypeName)
          Given a SQL type name return the corresponding TypeId.
 boolean getClassNameWasDelimitedIdentifier()
          For user types, tell whether or not the class name was a delimited identifier.
 String getCorrespondingJavaTypeName()
          Get the name of the corresponding Java type.
 int getJDBCTypeId()
          JDBC has its own idea of type identifiers which is different from the Derby internal type ids.
 int getMaximumMaximumWidth()
          Get the maximum maximum width of the type (that's not a typo).
 int getMaximumPrecision()
          Get the maximum precision of the type.
 int getMaximumScale()
          Get the maximum scale of the type.
 int getPrecision(DataTypeDescriptor leftType, DataTypeDescriptor rightType)
          Get the precision of the merge of two Decimals
 String getResultSetMetaDataTypeName()
          Get the name of the corresponding Java type.
static TypeId getRowMultiSet(String[] columnNames, DataTypeDescriptor[] columnTypes)
           
 int getScale(DataTypeDescriptor leftType, DataTypeDescriptor rightType)
          Get the scale of the merge of two decimals
static TypeId getSQLTypeForJavaType(String javaTypeName)
          Get a TypeId for the class that corresponds to the given Java type name.
 String getSQLTypeName()
          Returns the SQL name of the datatype.
 int getTypeFormatId()
           
static TypeId getUserDefinedTypeId(String className, boolean delimitedIdentifier)
           
static TypeId getUserDefinedTypeId(String schemaName, String unqualifiedName, String className)
          This factory method is used for ANSI UDTs.
 int hashCode()
           
static TypeId intervalTypeId(TypeId startField, TypeId endField)
           
 boolean isAnsiUDT()
          Return true if this is this type id describes an ANSI UDT
 boolean isBitTypeId()
          Is this a type id for a bit type?
 boolean isBlobTypeId()
          Is this a Blob?
 boolean isBooleanTypeId()
          Is this a type id for a boolean type?
 boolean isClobTypeId()
          Is this a Clob?
 boolean isComparable()
           
 boolean isConcatableTypeId()
          Is this a type id for a concatable type?
 boolean isDateTimeTimeStampTypeId()
          Is this a TypeId for DATE/TIME/TIMESTAMP
 boolean isDateTimeTimeStampTypeID()
          Is this DATE/TIME or TIMESTAMP?
 boolean isDecimalTypeId()
          Is this a type id for a decimal type?
 boolean isDoubleTypeId()
          Is this a TypeId for DOUBLE
 boolean isFixedStringTypeId()
          Is this a fixed string type?
 boolean isFloatingPointTypeId()
          Is this a TypeId for floating point (REAL/DOUBLE)
 boolean isIntegerTypeId()
          Is this a type id for an integer type?
 boolean isIntervalTypeId()
           
 boolean isLOBTypeId()
          Is this a type id for a LOB type?
 boolean isLongConcatableTypeId()
          Is this a type id for a long concatable type?
 boolean isLongVarbinaryTypeId()
          Is this a LongVarbinary?
 boolean isLongVarcharTypeId()
          Is this a LongVarchar?
 boolean isNumericTypeId()
          Is this a type id for a numeric type?
 boolean isRealTypeId()
          Is this a TypeId for REAL
 boolean isRefTypeId()
          Is this a type id for a ref type?
 boolean isRowMultiSet()
           
 boolean isStringTypeId()
          Does this TypeId represent a TypeId for a StringDataType.
 boolean isUnsigned()
          Is this one of the unsigned numeric types?
 boolean isUserDefinedTypeId()
          Is this a type id for a user defined type?
 boolean isXMLTypeId()
          Is this an XML doc?
 String toParsableString(DataTypeDescriptor dts)
          Converts this TypeId, given a data type descriptor (including length/precision), to a string.
 int typePrecedence()
          Each built-in type in JSQL has a precedence.
 boolean userType()
          Tell whether this is a built-in type.
 boolean variableLength()
          Does type hava a declared variable length (defined by the application).
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LONGINT_PRECISION

public static final int LONGINT_PRECISION
Various fixed numbers related to datatypes.

See Also:
Constant Field Values

LONGINT_SCALE

public static final int LONGINT_SCALE
See Also:
Constant Field Values

LONGINT_MAXWIDTH

public static final int LONGINT_MAXWIDTH
See Also:
Constant Field Values

INT_PRECISION

public static final int INT_PRECISION
See Also:
Constant Field Values

INT_SCALE

public static final int INT_SCALE
See Also:
Constant Field Values

INT_MAXWIDTH

public static final int INT_MAXWIDTH
See Also:
Constant Field Values

SMALLINT_PRECISION

public static final int SMALLINT_PRECISION
See Also:
Constant Field Values

SMALLINT_SCALE

public static final int SMALLINT_SCALE
See Also:
Constant Field Values

SMALLINT_MAXWIDTH

public static final int SMALLINT_MAXWIDTH
See Also:
Constant Field Values

TINYINT_PRECISION

public static final int TINYINT_PRECISION
See Also:
Constant Field Values

TINYINT_SCALE

public static final int TINYINT_SCALE
See Also:
Constant Field Values

TINYINT_MAXWIDTH

public static final int TINYINT_MAXWIDTH
See Also:
Constant Field Values

DOUBLE_PRECISION

public static final int DOUBLE_PRECISION
See Also:
Constant Field Values

DOUBLE_PRECISION_IN_DIGITS

public static final int DOUBLE_PRECISION_IN_DIGITS
See Also:
Constant Field Values

DOUBLE_SCALE

public static final int DOUBLE_SCALE
See Also:
Constant Field Values

DOUBLE_MAXWIDTH

public static final int DOUBLE_MAXWIDTH
See Also:
Constant Field Values

REAL_PRECISION

public static final int REAL_PRECISION
See Also:
Constant Field Values

REAL_PRECISION_IN_DIGITS

public static final int REAL_PRECISION_IN_DIGITS
See Also:
Constant Field Values

REAL_SCALE

public static final int REAL_SCALE
See Also:
Constant Field Values

REAL_MAXWIDTH

public static final int REAL_MAXWIDTH
See Also:
Constant Field Values

DECIMAL_PRECISION

public static final int DECIMAL_PRECISION
See Also:
Constant Field Values

DECIMAL_SCALE

public static final int DECIMAL_SCALE
See Also:
Constant Field Values

DECIMAL_MAXWIDTH

public static final int DECIMAL_MAXWIDTH
See Also:
Constant Field Values

DEFAULT_DECIMAL_PRECISION

public static final int DEFAULT_DECIMAL_PRECISION
See Also:
Constant Field Values

DEFAULT_DECIMAL_SCALE

public static final int DEFAULT_DECIMAL_SCALE
See Also:
Constant Field Values

BOOLEAN_MAXWIDTH

public static final int BOOLEAN_MAXWIDTH
See Also:
Constant Field Values

CHAR_MAXWIDTH

public static final int CHAR_MAXWIDTH
See Also:
Constant Field Values

VARCHAR_MAXWIDTH

public static final int VARCHAR_MAXWIDTH
See Also:
Constant Field Values

LONGVARCHAR_MAXWIDTH

public static final int LONGVARCHAR_MAXWIDTH
See Also:
Constant Field Values

BIT_MAXWIDTH

public static final int BIT_MAXWIDTH
See Also:
Constant Field Values

VARBIT_MAXWIDTH

public static final int VARBIT_MAXWIDTH
See Also:
Constant Field Values

LONGVARBIT_MAXWIDTH

public static final int LONGVARBIT_MAXWIDTH
See Also:
Constant Field Values

BLOB_MAXWIDTH

public static final int BLOB_MAXWIDTH
See Also:
Constant Field Values

CLOB_MAXWIDTH

public static final int CLOB_MAXWIDTH
See Also:
Constant Field Values

XML_MAXWIDTH

public static final int XML_MAXWIDTH
See Also:
Constant Field Values

DATE_MAXWIDTH

public static final int DATE_MAXWIDTH
See Also:
Constant Field Values

TIME_MAXWIDTH

public static final int TIME_MAXWIDTH
See Also:
Constant Field Values

TIMESTAMP_MAXWIDTH

public static final int TIMESTAMP_MAXWIDTH
See Also:
Constant Field Values

TIME_SCALE

public static final int TIME_SCALE
See Also:
Constant Field Values

TIMESTAMP_SCALE

public static final int TIMESTAMP_SCALE
See Also:
Constant Field Values

INTERVAL_YEAR_MONTH_PRECISION

public static final int INTERVAL_YEAR_MONTH_PRECISION
See Also:
Constant Field Values

INTERVAL_YEAR_MONTH_SCALE

public static final int INTERVAL_YEAR_MONTH_SCALE
See Also:
Constant Field Values

INTERVAL_YEAR_MONTH_MAXWIDTH

public static final int INTERVAL_YEAR_MONTH_MAXWIDTH
See Also:
Constant Field Values

INTERVAL_DAY_SECOND_PRECISION

public static final int INTERVAL_DAY_SECOND_PRECISION
See Also:
Constant Field Values

INTERVAL_DAY_SECOND_SCALE

public static final int INTERVAL_DAY_SECOND_SCALE
See Also:
Constant Field Values

INTERVAL_DAY_SECOND_MAXWIDTH

public static final int INTERVAL_DAY_SECOND_MAXWIDTH
See Also:
Constant Field Values

BIT_NAME

public static final String BIT_NAME
See Also:
Constant Field Values

VARBIT_NAME

public static final String VARBIT_NAME
See Also:
Constant Field Values

LONGVARBIT_NAME

public static final String LONGVARBIT_NAME
See Also:
Constant Field Values

TINYINT_NAME

public static final String TINYINT_NAME
See Also:
Constant Field Values

SMALLINT_NAME

public static final String SMALLINT_NAME
See Also:
Constant Field Values

MEDIUMINT_NAME

public static final String MEDIUMINT_NAME
See Also:
Constant Field Values

INTEGER_NAME

public static final String INTEGER_NAME
See Also:
Constant Field Values

INT_NAME

public static final String INT_NAME
See Also:
Constant Field Values

LONGINT_NAME

public static final String LONGINT_NAME
See Also:
Constant Field Values

FLOAT_NAME

public static final String FLOAT_NAME
See Also:
Constant Field Values

REAL_NAME

public static final String REAL_NAME
See Also:
Constant Field Values

DOUBLE_NAME

public static final String DOUBLE_NAME
See Also:
Constant Field Values

NUMERIC_NAME

public static final String NUMERIC_NAME
See Also:
Constant Field Values

DECIMAL_NAME

public static final String DECIMAL_NAME
See Also:
Constant Field Values

CHAR_NAME

public static final String CHAR_NAME
See Also:
Constant Field Values

VARCHAR_NAME

public static final String VARCHAR_NAME
See Also:
Constant Field Values

LONGVARCHAR_NAME

public static final String LONGVARCHAR_NAME
See Also:
Constant Field Values

DATE_NAME

public static final String DATE_NAME
See Also:
Constant Field Values

TIME_NAME

public static final String TIME_NAME
See Also:
Constant Field Values

TIMESTAMP_NAME

public static final String TIMESTAMP_NAME
See Also:
Constant Field Values

BINARY_NAME

public static final String BINARY_NAME
See Also:
Constant Field Values

VARBINARY_NAME

public static final String VARBINARY_NAME
See Also:
Constant Field Values

LONGVARBINARY_NAME

public static final String LONGVARBINARY_NAME
See Also:
Constant Field Values

BOOLEAN_NAME

public static final String BOOLEAN_NAME
See Also:
Constant Field Values

REF_NAME

public static final String REF_NAME
See Also:
Constant Field Values

NATIONAL_CHAR_NAME

public static final String NATIONAL_CHAR_NAME
See Also:
Constant Field Values

NATIONAL_VARCHAR_NAME

public static final String NATIONAL_VARCHAR_NAME
See Also:
Constant Field Values

NATIONAL_LONGVARCHAR_NAME

public static final String NATIONAL_LONGVARCHAR_NAME
See Also:
Constant Field Values

BLOB_NAME

public static final String BLOB_NAME
See Also:
Constant Field Values

CLOB_NAME

public static final String CLOB_NAME
See Also:
Constant Field Values

NCLOB_NAME

public static final String NCLOB_NAME
See Also:
Constant Field Values

TEXT_NAME

public static final String TEXT_NAME
See Also:
Constant Field Values

TINYBLOB_NAME

public static final String TINYBLOB_NAME
See Also:
Constant Field Values

TINYTEXT_NAME

public static final String TINYTEXT_NAME
See Also:
Constant Field Values

MEDIUMBLOB_NAME

public static final String MEDIUMBLOB_NAME
See Also:
Constant Field Values

MEDIUMTEXT_NAME

public static final String MEDIUMTEXT_NAME
See Also:
Constant Field Values

LONGBLOB_NAME

public static final String LONGBLOB_NAME
See Also:
Constant Field Values

LONGTEXT_NAME

public static final String LONGTEXT_NAME
See Also:
Constant Field Values

INTERVAL_YEAR_NAME

public static final String INTERVAL_YEAR_NAME
See Also:
Constant Field Values

INTERVAL_MONTH_NAME

public static final String INTERVAL_MONTH_NAME
See Also:
Constant Field Values

INTERVAL_YEAR_MONTH_NAME

public static final String INTERVAL_YEAR_MONTH_NAME
See Also:
Constant Field Values

INTERVAL_DAY_NAME

public static final String INTERVAL_DAY_NAME
See Also:
Constant Field Values

INTERVAL_HOUR_NAME

public static final String INTERVAL_HOUR_NAME
See Also:
Constant Field Values

INTERVAL_MINUTE_NAME

public static final String INTERVAL_MINUTE_NAME
See Also:
Constant Field Values

INTERVAL_SECOND_NAME

public static final String INTERVAL_SECOND_NAME
See Also:
Constant Field Values

INTERVAL_DAY_HOUR_NAME

public static final String INTERVAL_DAY_HOUR_NAME
See Also:
Constant Field Values

INTERVAL_DAY_MINUTE_NAME

public static final String INTERVAL_DAY_MINUTE_NAME
See Also:
Constant Field Values

INTERVAL_DAY_SECOND_NAME

public static final String INTERVAL_DAY_SECOND_NAME
See Also:
Constant Field Values

INTERVAL_HOUR_MINUTE_NAME

public static final String INTERVAL_HOUR_MINUTE_NAME
See Also:
Constant Field Values

INTERVAL_HOUR_SECOND_NAME

public static final String INTERVAL_HOUR_SECOND_NAME
See Also:
Constant Field Values

INTERVAL_MINUTE_SECOND_NAME

public static final String INTERVAL_MINUTE_SECOND_NAME
See Also:
Constant Field Values

XML_NAME

public static final String XML_NAME
See Also:
Constant Field Values

ARRAY_NAME

public static final String ARRAY_NAME
See Also:
Constant Field Values

STRUCT_NAME

public static final String STRUCT_NAME
See Also:
Constant Field Values

DATALINK_NAME

public static final String DATALINK_NAME
See Also:
Constant Field Values

ROWID_NAME

public static final String ROWID_NAME
See Also:
Constant Field Values

SQLXML_NAME

public static final String SQLXML_NAME
See Also:
Constant Field Values

TINYINT_UNSIGNED_NAME

public static final String TINYINT_UNSIGNED_NAME
See Also:
Constant Field Values

SMALLINT_UNSIGNED_NAME

public static final String SMALLINT_UNSIGNED_NAME
See Also:
Constant Field Values

MEDIUMINT_UNSIGNED_NAME

public static final String MEDIUMINT_UNSIGNED_NAME
See Also:
Constant Field Values

INTEGER_UNSIGNED_NAME

public static final String INTEGER_UNSIGNED_NAME
See Also:
Constant Field Values

INT_UNSIGNED_NAME

public static final String INT_UNSIGNED_NAME
See Also:
Constant Field Values

LONGINT_UNSIGNED_NAME

public static final String LONGINT_UNSIGNED_NAME
See Also:
Constant Field Values

FLOAT_UNSIGNED_NAME

public static final String FLOAT_UNSIGNED_NAME
See Also:
Constant Field Values

REAL_UNSIGNED_NAME

public static final String REAL_UNSIGNED_NAME
See Also:
Constant Field Values

DOUBLE_UNSIGNED_NAME

public static final String DOUBLE_UNSIGNED_NAME
See Also:
Constant Field Values

NUMERIC_UNSIGNED_NAME

public static final String NUMERIC_UNSIGNED_NAME
See Also:
Constant Field Values

DECIMAL_UNSIGNED_NAME

public static final String DECIMAL_UNSIGNED_NAME
See Also:
Constant Field Values

DATETIME_NAME

public static final String DATETIME_NAME
See Also:
Constant Field Values

YEAR_NAME

public static final String YEAR_NAME
See Also:
Constant Field Values

USER_PRECEDENCE

public static final int USER_PRECEDENCE
The following constants define the type precedence hierarchy.

See Also:
Constant Field Values

XML_PRECEDENCE

public static final int XML_PRECEDENCE
See Also:
Constant Field Values

BLOB_PRECEDENCE

public static final int BLOB_PRECEDENCE
See Also:
Constant Field Values

LONGVARBIT_PRECEDENCE

public static final int LONGVARBIT_PRECEDENCE
See Also:
Constant Field Values

VARBIT_PRECEDENCE

public static final int VARBIT_PRECEDENCE
See Also:
Constant Field Values

BIT_PRECEDENCE

public static final int BIT_PRECEDENCE
See Also:
Constant Field Values

BOOLEAN_PRECEDENCE

public static final int BOOLEAN_PRECEDENCE
See Also:
Constant Field Values

INTERVAL_PRECEDENCE

public static final int INTERVAL_PRECEDENCE
See Also:
Constant Field Values

TIME_PRECEDENCE

public static final int TIME_PRECEDENCE
See Also:
Constant Field Values

TIMESTAMP_PRECEDENCE

public static final int TIMESTAMP_PRECEDENCE
See Also:
Constant Field Values

DATE_PRECEDENCE

public static final int DATE_PRECEDENCE
See Also:
Constant Field Values

DOUBLE_PRECEDENCE

public static final int DOUBLE_PRECEDENCE
See Also:
Constant Field Values

REAL_PRECEDENCE

public static final int REAL_PRECEDENCE
See Also:
Constant Field Values

DECIMAL_PRECEDENCE

public static final int DECIMAL_PRECEDENCE
See Also:
Constant Field Values

NUMERIC_PRECEDENCE

public static final int NUMERIC_PRECEDENCE
See Also:
Constant Field Values

LONGINT_PRECEDENCE

public static final int LONGINT_PRECEDENCE
See Also:
Constant Field Values

INT_PRECEDENCE

public static final int INT_PRECEDENCE
See Also:
Constant Field Values

SMALLINT_PRECEDENCE

public static final int SMALLINT_PRECEDENCE
See Also:
Constant Field Values

TINYINT_PRECEDENCE

public static final int TINYINT_PRECEDENCE
See Also:
Constant Field Values

REF_PRECEDENCE

public static final int REF_PRECEDENCE
See Also:
Constant Field Values

CLOB_PRECEDENCE

public static final int CLOB_PRECEDENCE
See Also:
Constant Field Values

LONGVARCHAR_PRECEDENCE

public static final int LONGVARCHAR_PRECEDENCE
See Also:
Constant Field Values

VARCHAR_PRECEDENCE

public static final int VARCHAR_PRECEDENCE
See Also:
Constant Field Values

CHAR_PRECEDENCE

public static final int CHAR_PRECEDENCE
See Also:
Constant Field Values

BOOLEAN_ID

public static final TypeId BOOLEAN_ID

SMALLINT_ID

public static final TypeId SMALLINT_ID

MEDIUMINT_ID

public static final TypeId MEDIUMINT_ID

INTEGER_ID

public static final TypeId INTEGER_ID

CHAR_ID

public static final TypeId CHAR_ID

TINYINT_ID

public static final TypeId TINYINT_ID

BIGINT_ID

public static final TypeId BIGINT_ID

REAL_ID

public static final TypeId REAL_ID

DOUBLE_ID

public static final TypeId DOUBLE_ID

DECIMAL_ID

public static final TypeId DECIMAL_ID

NUMERIC_ID

public static final TypeId NUMERIC_ID

VARCHAR_ID

public static final TypeId VARCHAR_ID

DATE_ID

public static final TypeId DATE_ID

TIME_ID

public static final TypeId TIME_ID

TIMESTAMP_ID

public static final TypeId TIMESTAMP_ID

BIT_ID

public static final TypeId BIT_ID

VARBIT_ID

public static final TypeId VARBIT_ID

REF_ID

public static final TypeId REF_ID

LONGVARCHAR_ID

public static final TypeId LONGVARCHAR_ID

LONGVARBIT_ID

public static final TypeId LONGVARBIT_ID

BLOB_ID

public static final TypeId BLOB_ID

CLOB_ID

public static final TypeId CLOB_ID

XML_ID

public static final TypeId XML_ID

INTERVAL_YEAR_ID

public static final TypeId INTERVAL_YEAR_ID

INTERVAL_MONTH_ID

public static final TypeId INTERVAL_MONTH_ID

INTERVAL_YEAR_MONTH_ID

public static final TypeId INTERVAL_YEAR_MONTH_ID

INTERVAL_DAY_ID

public static final TypeId INTERVAL_DAY_ID

INTERVAL_HOUR_ID

public static final TypeId INTERVAL_HOUR_ID

INTERVAL_MINUTE_ID

public static final TypeId INTERVAL_MINUTE_ID

INTERVAL_SECOND_ID

public static final TypeId INTERVAL_SECOND_ID

INTERVAL_DAY_HOUR_ID

public static final TypeId INTERVAL_DAY_HOUR_ID

INTERVAL_DAY_MINUTE_ID

public static final TypeId INTERVAL_DAY_MINUTE_ID

INTERVAL_DAY_SECOND_ID

public static final TypeId INTERVAL_DAY_SECOND_ID

INTERVAL_HOUR_MINUTE_ID

public static final TypeId INTERVAL_HOUR_MINUTE_ID

INTERVAL_HOUR_SECOND_ID

public static final TypeId INTERVAL_HOUR_SECOND_ID

INTERVAL_MINUTE_SECOND_ID

public static final TypeId INTERVAL_MINUTE_SECOND_ID

SMALLINT_UNSIGNED_ID

public static final TypeId SMALLINT_UNSIGNED_ID

MEDIUMINT_UNSIGNED_ID

public static final TypeId MEDIUMINT_UNSIGNED_ID

INTEGER_UNSIGNED_ID

public static final TypeId INTEGER_UNSIGNED_ID

TINYINT_UNSIGNED_ID

public static final TypeId TINYINT_UNSIGNED_ID

BIGINT_UNSIGNED_ID

public static final TypeId BIGINT_UNSIGNED_ID

REAL_UNSIGNED_ID

public static final TypeId REAL_UNSIGNED_ID

DOUBLE_UNSIGNED_ID

public static final TypeId DOUBLE_UNSIGNED_ID

DECIMAL_UNSIGNED_ID

public static final TypeId DECIMAL_UNSIGNED_ID

NUMERIC_UNSIGNED_ID

public static final TypeId NUMERIC_UNSIGNED_ID

DATETIME_ID

public static final TypeId DATETIME_ID

YEAR_ID

public static final TypeId YEAR_ID

TEXT_ID

public static final TypeId TEXT_ID

TINYBLOB_ID

public static final TypeId TINYBLOB_ID

TINYTEXT_ID

public static final TypeId TINYTEXT_ID

MEDIUMBLOB_ID

public static final TypeId MEDIUMBLOB_ID

MEDIUMTEXT_ID

public static final TypeId MEDIUMTEXT_ID

LONGBLOB_ID

public static final TypeId LONGBLOB_ID

LONGTEXT_ID

public static final TypeId LONGTEXT_ID
Method Detail

getAllBuiltinTypeIds

public static TypeId[] getAllBuiltinTypeIds()
Return all of the builtin type ids.


getBuiltInTypeId

public static TypeId getBuiltInTypeId(int JDBCTypeId)
Get a TypeId of the given JDBC type. This factory method is intended to be used for built-in types. For user-defined types, we will need a factory method that takes a Java type name.

Parameters:
JDBCTypeId - The JDBC Id of the type, as listed in java.sql.Types
Returns:
The appropriate TypeId, or null if there is no such TypeId.

getUserDefinedTypeId

public static TypeId getUserDefinedTypeId(String className,
                                          boolean delimitedIdentifier)
                                   throws StandardException
Throws:
StandardException

getUserDefinedTypeId

public static TypeId getUserDefinedTypeId(String schemaName,
                                          String unqualifiedName,
                                          String className)
                                   throws StandardException
This factory method is used for ANSI UDTs. If the className argument is null, then this TypeId will have to be bound.

Parameters:
schemaName - Schema that the type definition lives in.
unqualifiedName - The second part of the ANSI dot-separated name for the type.
className - The Java class which is bound to the schema-qualified name by the CREATE TYPE statement.
Returns:
A bound type TypeId describing this ANSI UDT.
Throws:
StandardException

isAnsiUDT

public boolean isAnsiUDT()
Return true if this is this type id describes an ANSI UDT


getSQLTypeForJavaType

public static TypeId getSQLTypeForJavaType(String javaTypeName)
                                    throws StandardException
Get a TypeId for the class that corresponds to the given Java type name.

Parameters:
javaTypeName - The name of the Java type
Returns:
A TypeId for the SQL type that corresponds to the Java type, null if there is no corresponding type.
Throws:
StandardException

getBuiltInTypeId

public static TypeId getBuiltInTypeId(String SQLTypeName)
Given a SQL type name return the corresponding TypeId.

Parameters:
SQLTypeName - Name of SQL type
Returns:
TypeId or null if there is no corresponding SQL type.

getTypeFormatId

public int getTypeFormatId()

equals

public boolean equals(Object that)
we want equals to say if these are the same type id or not.

Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

getJDBCTypeId

public final int getJDBCTypeId()
JDBC has its own idea of type identifiers which is different from the Derby internal type ids. The JDBC type ids are defined as public final static ints in java.sql.Types. This method translates a Derby internal TypeId to a JDBC type id. For java objects this returns JAVA_OBJECT in Java2 and OTHER in JDK 1.1. For Boolean datatypes, this returns Type.BOOLEAN in JDK1.4 and Type.BIT for jdks prior to 1.4

Returns:
The JDBC type Id for this type

getSQLTypeName

public String getSQLTypeName()
Returns the SQL name of the datatype. If it is a user-defined type, it returns the full Java path name for the datatype, meaning the dot-separated path including the package names.

Returns:
A String containing the SQL name of this type.

userType

public final boolean userType()
Tell whether this is a built-in type. NOTE: There are 3 "classes" of types: built-in - system provided types which are implemented internally (int, smallint, etc.) system built-in - system provided types, independent of implementation (date, time, etc.) user types - types implemented outside of the system (java.lang.Integer, asdf.asdf.asdf, etc.)

Returns:
false for built-in types, true for user-defined types.

getMaximumPrecision

public int getMaximumPrecision()
Get the maximum precision of the type. For types with variable precision, this is an arbitrary high precision.

Returns:
The maximum precision of the type

getMaximumScale

public int getMaximumScale()
Get the maximum scale of the type. For types with variable scale, this is an arbitrary high scale.

Returns:
The maximum scale of the type

getClassNameWasDelimitedIdentifier

public boolean getClassNameWasDelimitedIdentifier()
For user types, tell whether or not the class name was a delimited identifier. For all other types, return false.

Returns:
Whether or not the class name was a delimited identifier.

isStringTypeId

public boolean isStringTypeId()
Does this TypeId represent a TypeId for a StringDataType.

Returns:
Whether or not this TypeId represents a TypeId for a StringDataType.

isDateTimeTimeStampTypeId

public boolean isDateTimeTimeStampTypeId()
Is this a TypeId for DATE/TIME/TIMESTAMP

Returns:
true if this is a DATE/TIME/TIMESTAMP

isRealTypeId

public boolean isRealTypeId()
Is this a TypeId for REAL

Returns:
true if this is a REAL

isFloatingPointTypeId

public boolean isFloatingPointTypeId()
Is this a TypeId for floating point (REAL/DOUBLE)

Returns:
true if this is a REAL or DOUBLE

isDoubleTypeId

public boolean isDoubleTypeId()
Is this a TypeId for DOUBLE

Returns:
true if this is a DOUBLE

isFixedStringTypeId

public boolean isFixedStringTypeId()
Is this a fixed string type?

Returns:
true if this is CHAR

isClobTypeId

public boolean isClobTypeId()
Is this a Clob?

Returns:
true if this is CLOB

isBlobTypeId

public boolean isBlobTypeId()
Is this a Blob?

Returns:
true if this is BLOB

isLongVarcharTypeId

public boolean isLongVarcharTypeId()
Is this a LongVarchar?

Returns:
true if this is LongVarchar

isLongVarbinaryTypeId

public boolean isLongVarbinaryTypeId()
Is this a LongVarbinary?

Returns:
true if this is LongVarbinary

isDateTimeTimeStampTypeID

public boolean isDateTimeTimeStampTypeID()
Is this DATE/TIME or TIMESTAMP?

Returns:
true if this DATE/TIME or TIMESTAMP

isXMLTypeId

public boolean isXMLTypeId()
Is this an XML doc?

Returns:
true if this is XML

isComparable

public boolean isComparable()
Returns:
false if this type is not comparable to any other types or even to itself true otherwise.

typePrecedence

public int typePrecedence()
Each built-in type in JSQL has a precedence. This precedence determines how to do type promotion when using binary operators. For example, float has a higher precedence than int, so when adding an int to a float, the result type is float. The precedence for some types is arbitrary. For example, it doesn't matter what the precedence of the boolean type is, since it can't be mixed with other types. But the precedence for the number types is critical. The SQL standard requires that exact numeric types be promoted to approximate numeric when one operator uses both. Also, the precedence is arranged so that one will not lose precision when promoting a type. NOTE: char, varchar, and longvarchar must appear at the bottom of the hierarchy, but above USER_PRECEDENCE, since we allow the implicit conversion of those types to any other built-in system type.

Returns:
The precedence of this type.

getCorrespondingJavaTypeName

public String getCorrespondingJavaTypeName()
Get the name of the corresponding Java type. Each SQL type has a corresponding Java type. When a SQL value is passed to a Java method, it is translated to its corresponding Java type. For example, when a SQL date column is passed to a method, it is translated to a java.sql.Date.

Returns:
The name of the corresponding Java type.

getResultSetMetaDataTypeName

public String getResultSetMetaDataTypeName()
Get the name of the corresponding Java type. This method is used directly from EmbedResultSetMetaData (jdbc) to return the corresponding type (as choosen by getObject). It solves a specific problem for BLOB types where the getCorrespondingJavaTypeName() is used internally for casting which doesn't work if changed from byte[] to java.sql.Blob. So we do it here instead, to avoid unexpected side effects.

Returns:
The name of the corresponding Java type.

getMaximumMaximumWidth

public int getMaximumMaximumWidth()
Get the maximum maximum width of the type (that's not a typo). For types with variable length, this is the absolute maximum for the type.

Returns:
The maximum maximum width of the type

toParsableString

public String toParsableString(DataTypeDescriptor dts)
Converts this TypeId, given a data type descriptor (including length/precision), to a string. E.g. VARCHAR(30) For most data types, we just return the SQL type name.

Parameters:
dts - Data type descriptor that holds the length/precision etc. as necessary
Returns:
String version of datatype, suitable for running through the Parser.

isNumericTypeId

public boolean isNumericTypeId()
Is this a type id for a numeric type?

Returns:
Whether or not this a type id for a numeric type.

isDecimalTypeId

public boolean isDecimalTypeId()
Is this a type id for a decimal type?

Returns:
Whether or not this a type id for a decimal type.

isIntegerTypeId

public boolean isIntegerTypeId()
Is this a type id for an integer type?

Returns:
Whether or not this a type id for a integer type.

isBooleanTypeId

public boolean isBooleanTypeId()
Is this a type id for a boolean type?

Returns:
Whether or not this a type id for a boolean type.

isRefTypeId

public boolean isRefTypeId()
Is this a type id for a ref type?

Returns:
Whether or not this a type id for a ref type.

isConcatableTypeId

public boolean isConcatableTypeId()
Is this a type id for a concatable type?

Returns:
Whether or not this a type id for a concatable type.

isBitTypeId

public boolean isBitTypeId()
Is this a type id for a bit type?

Returns:
Whether or not this a type id for a bit type.

isLOBTypeId

public boolean isLOBTypeId()
Is this a type id for a LOB type?

Returns:
Whether or not this a type id for a LOB type.

isLongConcatableTypeId

public boolean isLongConcatableTypeId()
Is this a type id for a long concatable type?

Returns:
Whether or not this a type id for a long concatable type.

isUserDefinedTypeId

public boolean isUserDefinedTypeId()
Is this a type id for a user defined type?

Returns:
Whether or not this a type id for a user defined type.

getPrecision

public int getPrecision(DataTypeDescriptor leftType,
                        DataTypeDescriptor rightType)
Get the precision of the merge of two Decimals

Parameters:
leftType - the left type
rightType - the left type
Returns:
the resultant precision

getScale

public int getScale(DataTypeDescriptor leftType,
                    DataTypeDescriptor rightType)
Get the scale of the merge of two decimals

Parameters:
leftType - the left type
rightType - the left type
Returns:
the resultant precision

variableLength

public boolean variableLength()
Does type hava a declared variable length (defined by the application). Examples are CHAR(10), CLOB(1M). Unbounded long types, like LONG VARCHAR return false here.

Returns:
boolean true if type is variable length false if not.

getRowMultiSet

public static TypeId getRowMultiSet(String[] columnNames,
                                    DataTypeDescriptor[] columnTypes)

isRowMultiSet

public boolean isRowMultiSet()

isUnsigned

public boolean isUnsigned()
Is this one of the unsigned numeric types?


intervalTypeId

public static TypeId intervalTypeId(TypeId startField,
                                    TypeId endField)
                             throws StandardException
Throws:
StandardException

isIntervalTypeId

public boolean isIntervalTypeId()


Copyright © 2013 Akiban Technologies, Inc. All rights reserved.