public class TypeId
extends java.lang.Object
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.
DataTypeDescriptor
Modifier and Type | Class and Description |
---|---|
static class |
TypeId.FormatIds |
static class |
TypeId.RowMultiSetTypeId |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.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(java.lang.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.
|
java.lang.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
|
java.lang.String |
getResultSetMetaDataTypeName()
Get the name of the corresponding Java type.
|
static TypeId |
getRowMultiSet(java.lang.String[] columnNames,
DataTypeDescriptor[] columnTypes) |
int |
getScale(DataTypeDescriptor leftType,
DataTypeDescriptor rightType)
Get the scale of the merge of two decimals
|
static TypeId |
getSQLTypeForJavaType(java.lang.String javaTypeName)
Get a TypeId for the class that corresponds to the given Java type
name.
|
java.lang.String |
getSQLTypeName()
Returns the SQL name of the datatype.
|
int |
getTypeFormatId() |
static TypeId |
getUserDefinedTypeId(java.lang.String className,
boolean delimitedIdentifier) |
static TypeId |
getUserDefinedTypeId(java.lang.String schemaName,
java.lang.String unqualifiedName,
java.lang.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?
|
java.lang.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).
|
public static final int LONGINT_PRECISION
public static final int LONGINT_SCALE
public static final int LONGINT_MAXWIDTH
public static final int INT_PRECISION
public static final int INT_SCALE
public static final int INT_MAXWIDTH
public static final int SMALLINT_PRECISION
public static final int SMALLINT_SCALE
public static final int SMALLINT_MAXWIDTH
public static final int TINYINT_PRECISION
public static final int TINYINT_SCALE
public static final int TINYINT_MAXWIDTH
public static final int DOUBLE_PRECISION
public static final int DOUBLE_PRECISION_IN_DIGITS
public static final int DOUBLE_SCALE
public static final int DOUBLE_MAXWIDTH
public static final int REAL_PRECISION
public static final int REAL_PRECISION_IN_DIGITS
public static final int REAL_SCALE
public static final int REAL_MAXWIDTH
public static final int DECIMAL_PRECISION
public static final int DECIMAL_SCALE
public static final int DECIMAL_MAXWIDTH
public static final int DEFAULT_DECIMAL_PRECISION
public static final int DEFAULT_DECIMAL_SCALE
public static final int BOOLEAN_MAXWIDTH
public static final int CHAR_MAXWIDTH
public static final int VARCHAR_MAXWIDTH
public static final int LONGVARCHAR_MAXWIDTH
public static final int BIT_MAXWIDTH
public static final int VARBIT_MAXWIDTH
public static final int LONGVARBIT_MAXWIDTH
public static final int BLOB_MAXWIDTH
public static final int CLOB_MAXWIDTH
public static final int XML_MAXWIDTH
public static final int DATE_MAXWIDTH
public static final int TIME_MAXWIDTH
public static final int TIMESTAMP_MAXWIDTH
public static final int TIME_SCALE
public static final int TIMESTAMP_SCALE
public static final int INTERVAL_YEAR_MONTH_PRECISION
public static final int INTERVAL_YEAR_MONTH_SCALE
public static final int INTERVAL_YEAR_MONTH_MAXWIDTH
public static final int INTERVAL_DAY_SECOND_PRECISION
public static final int INTERVAL_DAY_SECOND_SCALE
public static final int INTERVAL_DAY_SECOND_MAXWIDTH
public static final java.lang.String BIT_NAME
public static final java.lang.String VARBIT_NAME
public static final java.lang.String LONGVARBIT_NAME
public static final java.lang.String TINYINT_NAME
public static final java.lang.String SMALLINT_NAME
public static final java.lang.String MEDIUMINT_NAME
public static final java.lang.String INTEGER_NAME
public static final java.lang.String INT_NAME
public static final java.lang.String LONGINT_NAME
public static final java.lang.String FLOAT_NAME
public static final java.lang.String REAL_NAME
public static final java.lang.String DOUBLE_NAME
public static final java.lang.String NUMERIC_NAME
public static final java.lang.String DECIMAL_NAME
public static final java.lang.String CHAR_NAME
public static final java.lang.String VARCHAR_NAME
public static final java.lang.String LONGVARCHAR_NAME
public static final java.lang.String DATE_NAME
public static final java.lang.String TIME_NAME
public static final java.lang.String TIMESTAMP_NAME
public static final java.lang.String BINARY_NAME
public static final java.lang.String VARBINARY_NAME
public static final java.lang.String LONGVARBINARY_NAME
public static final java.lang.String BOOLEAN_NAME
public static final java.lang.String REF_NAME
public static final java.lang.String NATIONAL_CHAR_NAME
public static final java.lang.String NATIONAL_VARCHAR_NAME
public static final java.lang.String NATIONAL_LONGVARCHAR_NAME
public static final java.lang.String BLOB_NAME
public static final java.lang.String CLOB_NAME
public static final java.lang.String NCLOB_NAME
public static final java.lang.String INTERVAL_YEAR_NAME
public static final java.lang.String INTERVAL_MONTH_NAME
public static final java.lang.String INTERVAL_YEAR_MONTH_NAME
public static final java.lang.String INTERVAL_DAY_NAME
public static final java.lang.String INTERVAL_HOUR_NAME
public static final java.lang.String INTERVAL_MINUTE_NAME
public static final java.lang.String INTERVAL_SECOND_NAME
public static final java.lang.String INTERVAL_DAY_HOUR_NAME
public static final java.lang.String INTERVAL_DAY_MINUTE_NAME
public static final java.lang.String INTERVAL_DAY_SECOND_NAME
public static final java.lang.String INTERVAL_HOUR_MINUTE_NAME
public static final java.lang.String INTERVAL_HOUR_SECOND_NAME
public static final java.lang.String INTERVAL_MINUTE_SECOND_NAME
public static final java.lang.String XML_NAME
public static final java.lang.String ARRAY_NAME
public static final java.lang.String STRUCT_NAME
public static final java.lang.String DATALINK_NAME
public static final java.lang.String ROWID_NAME
public static final java.lang.String SQLXML_NAME
public static final java.lang.String TINYINT_UNSIGNED_NAME
public static final java.lang.String SMALLINT_UNSIGNED_NAME
public static final java.lang.String MEDIUMINT_UNSIGNED_NAME
public static final java.lang.String INTEGER_UNSIGNED_NAME
public static final java.lang.String INT_UNSIGNED_NAME
public static final java.lang.String LONGINT_UNSIGNED_NAME
public static final java.lang.String FLOAT_UNSIGNED_NAME
public static final java.lang.String REAL_UNSIGNED_NAME
public static final java.lang.String DOUBLE_UNSIGNED_NAME
public static final java.lang.String NUMERIC_UNSIGNED_NAME
public static final java.lang.String DECIMAL_UNSIGNED_NAME
public static final java.lang.String DATETIME_NAME
public static final java.lang.String YEAR_NAME
public static final int USER_PRECEDENCE
public static final int XML_PRECEDENCE
public static final int BLOB_PRECEDENCE
public static final int LONGVARBIT_PRECEDENCE
public static final int VARBIT_PRECEDENCE
public static final int BIT_PRECEDENCE
public static final int BOOLEAN_PRECEDENCE
public static final int INTERVAL_PRECEDENCE
public static final int TIME_PRECEDENCE
public static final int TIMESTAMP_PRECEDENCE
public static final int DATE_PRECEDENCE
public static final int DOUBLE_PRECEDENCE
public static final int REAL_PRECEDENCE
public static final int DECIMAL_PRECEDENCE
public static final int NUMERIC_PRECEDENCE
public static final int LONGINT_PRECEDENCE
public static final int INT_PRECEDENCE
public static final int SMALLINT_PRECEDENCE
public static final int TINYINT_PRECEDENCE
public static final int REF_PRECEDENCE
public static final int CLOB_PRECEDENCE
public static final int LONGVARCHAR_PRECEDENCE
public static final int VARCHAR_PRECEDENCE
public static final int CHAR_PRECEDENCE
public static final TypeId BOOLEAN_ID
public static final TypeId SMALLINT_ID
public static final TypeId MEDIUMINT_ID
public static final TypeId INTEGER_ID
public static final TypeId CHAR_ID
public static final TypeId TINYINT_ID
public static final TypeId BIGINT_ID
public static final TypeId REAL_ID
public static final TypeId DOUBLE_ID
public static final TypeId DECIMAL_ID
public static final TypeId NUMERIC_ID
public static final TypeId VARCHAR_ID
public static final TypeId DATE_ID
public static final TypeId TIME_ID
public static final TypeId TIMESTAMP_ID
public static final TypeId BIT_ID
public static final TypeId VARBIT_ID
public static final TypeId REF_ID
public static final TypeId LONGVARCHAR_ID
public static final TypeId LONGVARBIT_ID
public static final TypeId BLOB_ID
public static final TypeId CLOB_ID
public static final TypeId XML_ID
public static final TypeId INTERVAL_YEAR_ID
public static final TypeId INTERVAL_MONTH_ID
public static final TypeId INTERVAL_YEAR_MONTH_ID
public static final TypeId INTERVAL_DAY_ID
public static final TypeId INTERVAL_HOUR_ID
public static final TypeId INTERVAL_MINUTE_ID
public static final TypeId INTERVAL_SECOND_ID
public static final TypeId INTERVAL_DAY_HOUR_ID
public static final TypeId INTERVAL_DAY_MINUTE_ID
public static final TypeId INTERVAL_DAY_SECOND_ID
public static final TypeId INTERVAL_HOUR_MINUTE_ID
public static final TypeId INTERVAL_HOUR_SECOND_ID
public static final TypeId INTERVAL_MINUTE_SECOND_ID
public static final TypeId SMALLINT_UNSIGNED_ID
public static final TypeId MEDIUMINT_UNSIGNED_ID
public static final TypeId INTEGER_UNSIGNED_ID
public static final TypeId TINYINT_UNSIGNED_ID
public static final TypeId BIGINT_UNSIGNED_ID
public static final TypeId REAL_UNSIGNED_ID
public static final TypeId DOUBLE_UNSIGNED_ID
public static final TypeId DECIMAL_UNSIGNED_ID
public static final TypeId NUMERIC_UNSIGNED_ID
public static final TypeId DATETIME_ID
public static final TypeId YEAR_ID
public static TypeId[] getAllBuiltinTypeIds()
public static TypeId getBuiltInTypeId(int JDBCTypeId)
JDBCTypeId
- The JDBC Id of the type, as listed in
java.sql.Typespublic static TypeId getUserDefinedTypeId(java.lang.String className, boolean delimitedIdentifier) throws StandardException
StandardException
public static TypeId getUserDefinedTypeId(java.lang.String schemaName, java.lang.String unqualifiedName, java.lang.String className) throws StandardException
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.StandardException
public boolean isAnsiUDT()
public static TypeId getSQLTypeForJavaType(java.lang.String javaTypeName) throws StandardException
javaTypeName
- The name of the Java typeStandardException
public static TypeId getBuiltInTypeId(java.lang.String SQLTypeName)
SQLTypeName
- Name of SQL typepublic int getTypeFormatId()
public boolean equals(java.lang.Object that)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public final int getJDBCTypeId()
public java.lang.String getSQLTypeName()
public final boolean userType()
public int getMaximumPrecision()
public int getMaximumScale()
public boolean getClassNameWasDelimitedIdentifier()
public boolean isStringTypeId()
public boolean isDateTimeTimeStampTypeId()
public boolean isRealTypeId()
public boolean isFloatingPointTypeId()
public boolean isDoubleTypeId()
public boolean isFixedStringTypeId()
public boolean isClobTypeId()
public boolean isBlobTypeId()
public boolean isLongVarcharTypeId()
public boolean isLongVarbinaryTypeId()
public boolean isDateTimeTimeStampTypeID()
public boolean isXMLTypeId()
public boolean isComparable()
false
if this type is not comparable to any other types or even to itself
true
otherwise.public int typePrecedence()
public java.lang.String getCorrespondingJavaTypeName()
public java.lang.String getResultSetMetaDataTypeName()
public int getMaximumMaximumWidth()
public java.lang.String toParsableString(DataTypeDescriptor dts)
dts
- Data type descriptor that holds the length/precision etc. as necessarypublic boolean isNumericTypeId()
public boolean isDecimalTypeId()
public boolean isIntegerTypeId()
public boolean isBooleanTypeId()
public boolean isRefTypeId()
public boolean isConcatableTypeId()
public boolean isBitTypeId()
public boolean isLOBTypeId()
public boolean isLongConcatableTypeId()
public boolean isUserDefinedTypeId()
public int getPrecision(DataTypeDescriptor leftType, DataTypeDescriptor rightType)
leftType
- the left typerightType
- the left typepublic int getScale(DataTypeDescriptor leftType, DataTypeDescriptor rightType)
leftType
- the left typerightType
- the left typepublic boolean variableLength()
public static TypeId getRowMultiSet(java.lang.String[] columnNames, DataTypeDescriptor[] columnTypes)
public boolean isRowMultiSet()
public boolean isUnsigned()
public static TypeId intervalTypeId(TypeId startField, TypeId endField) throws StandardException
StandardException
public boolean isIntervalTypeId()
Copyright © 2013. All Rights Reserved.