Top Description Fields Constructors Methods
org.apache.derby.iapi.types

public final Class TypeId

extends Object
Class Inheritance
Imports
java.sql.Types, org.apache.derby.catalog.TypeDescriptor, org.apache.derby.catalog.types.BaseTypeIdImpl, .DecimalTypeIdImpl, .TypeDescriptorImpl, .UserDefinedTypeIdImpl, org.apache.derby.shared.common.error.StandardException, org.apache.derby.shared.common.reference.DRDAConstants, .Limits, org.apache.derby.iapi.services.io.StoredFormatIds, org.apache.derby.iapi.services.loader.ClassFactory, org.apache.derby.shared.common.sanity.SanityManager

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

Field Summary

Modifier and TypeField and Description
private static final TypeId[]
public static final String
private BaseTypeIdImpl
public static final TypeId
public static final String
public static final String
private static final TypeId
public static final int
public static final String
public static final int
private static final TypeId
public static final int
public static final String
public static final int
public static final TypeId
public static final int
public static final String
public static final int
public static final TypeId
public static final int
public static final String
public static final int
private static final TypeId
public static final int
public static final String
public static final int
private static final TypeId
public static final int
public static final String
public static final int
private static final TypeId
public static final int
public static final String
public static final int
public static final int
public static final int
public static final TypeId
public static final int
public static final String
public static final int
public static final int
public static final int
public static final int
public static final String
private int
public static final int
public static final int
public static final int
public static final int
public static final TypeId
public static final String
private boolean
private boolean
private boolean
private boolean
private boolean
private boolean
private boolean
private boolean
private boolean
private boolean
private boolean
private boolean
private boolean
private String
public static final int
public static final int
public static final int
LONGINT_PRECISION

Various fixed numbers related to datatypes.

public static final int
public static final String
private static final TypeId
public static final int
public static final String
public static final int
private static final TypeId
public static final int
public static final String
public static final int
private int
private int
private int
public static final String
public static final String
public static final String
public static final String
private static final TypeId
public static final String
public static final int
private static final TypeId
public static final int
public static final String
public static final int
public static final int
public static final int
public static final int
public static final String
private static final TypeId
public static final String
public static final int
public static final String
public static final TypeId
public static final int
public static final String
public static final int
public static final int
public static final int
public static final String
public static final String
private static final TypeId
public static final int
public static final String
public static final int
public static final int
private static final TypeId
public static final int
public static final String
public static final int
public static final int
private static final TypeId
public static final int
public static final String
public static final int
public static final int
public static final int
private int
public static final int
USER_PRECEDENCE

The following constants define the type precedence hierarchy.

public static final String
private static final TypeId
public static final int
public static final String
public static final int
private static final TypeId
public static final int
public static final String
public static final int
private static final TypeId
public static final int
public static final String
public static final int

Constructor Summary

AccessConstructor and Description
public
TypeId(int
Format id of specific type id.
formatId
,
BaseTypeIdImpl
The Base type id
baseTypeId
)

Constructor for a TypeId

Method Summary

Modifier and TypeMethod and Description
private static TypeId
create(int typeFormatId, int implTypeFormatId)

Create a TypeId for the given format identifiers using a BaseTypeIdImpl.

public boolean
equals(Object
the reference object with which to compare.
that
)

Overrides java.lang.Object.equals.

we want equals to say if these are the same type id or not.

public static TypeId[]
getAllBuiltinTypeIds()

Return all of the builtin type ids.

public int

Returns:

the length in bytes
getApproximateLengthInBytes
(DataTypeDescriptor
Data type descriptor that holds the length/precision etc. as necessary
dts
)

Get the approximate length of this type in bytes.

public BaseTypeIdImpl
getBaseTypeId()

Get the base type id that is embedded in this type id. The base type id is an object with a minimal implementation of TypeId that is intended to be usable on the client side.

public static TypeId

Returns:

The appropriate TypeId, or null if there is no such TypeId.
getBuiltInTypeId
(int
The JDBC Id of the type, as listed in java.sql.Types
JDBCTypeId
)

Get a TypeId of the given JDBC type.

public static TypeId

Returns:

TypeId or null if there is no corresponding SQL type.
getBuiltInTypeId
(String
Name of SQL type
SQLTypeName
)

Given a SQL type name return the corresponding TypeId.

public String

Returns:

The name of the corresponding Java type.
getCorrespondingJavaTypeName
()

Get the name of the corresponding Java type.

public final int

Returns:

The JDBC type Id for this type
getJDBCTypeId
()

JDBC has its own idea of type identifiers which is different from the Derby internal type ids.

public int

Returns:

The maximum maximum width of the type
getMaximumMaximumWidth
()

Get the maximum maximum width of the type (that's not a typo).

public int

Returns:

The maximum precision of the type
getMaximumPrecision
()

Get the maximum precision of the type.

public int

Returns:

The maximum scale of the type
getMaximumScale
()

Get the maximum scale of the type.

public DataValueDescriptor

Returns:

SQL null value for this type.
getNull
()

Get SQL null value.

public int

Returns:

the resultant precision
getPrecision
(DataTypeDescriptor
the left type
leftType
,
DataTypeDescriptor
the left type
rightType
)

Get the precision of the merge of two Decimals

public String

Returns:

The name of the corresponding Java type.
getResultSetMetaDataTypeName
()

Get the name of the corresponding Java type.

public int

Returns:

the resultant precision
getScale
(DataTypeDescriptor
the left type
leftType
,
DataTypeDescriptor
the left type
rightType
)

Get the scale of the merge of two decimals

public static TypeId

Returns:

A TypeId for the SQL type that corresponds to the Java type, null if there is no corresponding type.
getSQLTypeForJavaType
(String
The name of the Java type
javaTypeName
)

Get a TypeId for the class that corresponds to the given Java type name.

public String

Returns:

A String containing the SQL name of this type.
getSQLTypeName
()

Returns the SQL name of the datatype.

public int

Returns:

the formatID of this class
getTypeFormatId
()

Get the formatID which corresponds to this class.

public static TypeId

Returns:

TypeId that represents the base type, null if not applicable.
getTypeId
(TypeDescriptor catalogType)

Get the TypeId (fundemental type information) for a catalog type.

public static TypeId
public static TypeId

Returns:

A bound type TypeId describing this ANSI UDT.
getUserDefinedTypeId
(String
Schema that the type definition lives in.
schemaName
,
String
The second part of the ANSI dot-separated name for the type.
unqualifiedName
,
String
The Java class which is bound to the schema-qualified name by the CREATE TYPE statement.
className
)

This factory method is used for ANSI UDTs.

public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for this object.

public boolean

Returns:

Whether or not this a type id for a bit type.
isBitTypeId
()

Is this a type id for a bit type?

public boolean

Returns:

true if this is BLOB
isBlobTypeId
()

Is this a Blob?

public boolean

Returns:

Whether or not this a type id for a boolean type.
isBooleanTypeId
()

Is this a type id for a boolean type?

public boolean

Returns:

true if this is CLOB
isClobTypeId
()

Is this a Clob?

public boolean

Returns:

Whether or not this a type id for a concatable type.
isConcatableTypeId
()

Is this a type id for a concatable type?

public boolean

Returns:

true if this is a DATE/TIME/TIMESTAMP
isDateTimeTimeStampTypeId
()

Is this a TypeId for DATE/TIME/TIMESTAMP

public boolean

Returns:

true if this DATE/TIME or TIMESTAMP
isDateTimeTimeStampTypeID
()

Is this DATE/TIME or TIMESTAMP?

public boolean

Returns:

Whether or not this a type id for a decimal type.
isDecimalTypeId
()

Is this a type id for a decimal type?

public boolean

Returns:

true if this is a DOUBLE
isDoubleTypeId
()

Is this a TypeId for DOUBLE

public boolean

Returns:

true if this is CHAR
isFixedStringTypeId
()

Is this a fixed string type?

public boolean

Returns:

true if this is a REAL or DOUBLE
isFloatingPointTypeId
()

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

public boolean

Returns:

Whether or not this a type id for a LOB type.
isLOBTypeId
()

Is this a type id for a LOB type?

public boolean

Returns:

Whether or not this a type id for a long concatable type.
isLongConcatableTypeId
()

Is this a type id for a long concatable type?

public boolean

Returns:

true if this is LongVarbinary
isLongVarbinaryTypeId
()

Is this a LongVarbinary?

public boolean

Returns:

true if this is LongVarchar
isLongVarcharTypeId
()

Is this a LongVarchar?

public boolean

Returns:

Whether or not this a type id for a numeric type.
isNumericTypeId
()

Is this a type id for a numeric type?

public boolean

Returns:

true if this is a REAL
isRealTypeId
()

Is this a TypeId for REAL

public boolean

Returns:

Whether or not this a type id for a ref type.
isRefTypeId
()

Is this a type id for a ref type?

public boolean

Returns:

Whether or not this TypeId represents a TypeId for a StringDataType.
isStringTypeId
()

Does this TypeId represent a TypeId for a StringDataType.

public boolean

Returns:

true if this is a TIMESTAMP
isTimestampId
()

Is this a TIMESTAMP?

public boolean

Returns:

Whether or not this a type id for a user defined type.
isUserDefinedTypeId
()

Is this a type id for a user defined type?

public boolean

Returns:

true if this is XML
isXMLTypeId
()

Is this an XML doc?

public boolean

Returns:

true for orderable types, false for non-orderable types.
orderable
(ClassFactory
A ClassFactory
cf
)

Tell whether this type is orderable, that is, can participate in comparisons.

private void
private void
public boolean

Returns:

true if this type has variable length.
streamStorable
()

Is this type StreamStorable?

public String

Returns:

String version of datatype, suitable for running through the Parser.
toParsableString
(DataTypeDescriptor
Data type descriptor that holds the length/precision etc. as necessary
dts
)

Converts this TypeId, given a data type descriptor (including length/precision), to a string.

public int

Returns:

The precedence of this type.
typePrecedence
()

Each built-in type in JSQL has a precedence.

public final boolean

Returns:

true for built-in types, false for user-defined types.
userType
()

Tell whether this is a built-in type.

public boolean

Returns:

boolean true if type is variable length false if not.
variableLength
()

Does type hava a declared variable length (defined by the application).

Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAlltoStringwaitwaitwait