org.jooq
Interface DataType<T>

Type Parameters:
T - The Java type associated with this SQL data type
All Superinterfaces:
Serializable
All Known Implementing Classes:
AbstractDataType, ASEDataType, CUBRIDDataType, DB2DataType, DerbyDataType, FirebirdDataType, H2DataType, HSQLDBDataType, IngresDataType, MySQLDataType, OracleDataType, PostgresDataType, SQLDataType, SQLiteDataType, SQLServerDataType, SybaseDataType

public interface DataType<T>
extends Serializable

A common interface to all dialect-specific data types

Author:
Lukas Eder

Method Summary
<A extends ArrayRecord<T>>
DataType<A>
asArrayDataType(Class<A> arrayDataType)
          Retrieve the data type for an Oracle-style ARRAY of this data type
<U> DataType<U>
asConvertedDataType(Converter<? super T,U> converter)
          Retrieve the data type for a given converter
<E extends EnumType>
DataType<E>
asEnumDataType(Class<E> enumDataType)
          Retrieve the data type for a given enum data type
<M extends MasterDataType<T>>
DataType<M>
asMasterDataType(Class<M> masterDataType)
          Deprecated. - 2.5.0 [#1741] - This feature will be removed as of jOOQ 3.0
 List<T> convert(Collection<?> objects)
          Convert an arbitrary set of objects into <T>
 T[] convert(Object... objects)
          Convert an arbitrary set of objects into <T>
 T convert(Object object)
          Convert an arbitrary object into <T>
 DataType<T[]> getArrayDataType()
          Retrieve the data type for an ARRAY of this data type
 Class<? extends T[]> getArrayType()
          Retrieve the Java type associated with ARRAYs of this data type
 String getCastTypeName()
          Retrieve the dialect-specific type name associated with this data type used for casting This is useful for some dialects that have specialised type names for cast expressions.
 String getCastTypeName(Configuration configuration)
          Retrieve the dialect-specific type name associated with this data type used for casting This is useful for some dialects that have specialised type names for cast expressions.
 String getCastTypeName(Configuration configuration, int length)
          Retrieve the dialect-specific type name associated with this data type used for casting This is useful for some dialects that have specialised type names for cast expressions.
 String getCastTypeName(Configuration configuration, int precision, int scale)
          Retrieve the dialect-specific type name associated with this data type used for casting This is useful for some dialects that have specialised type names for cast expressions.
 DataType<T> getDataType(Configuration configuration)
          The dialect-specific data type representing this data type.
 SQLDialect getDialect()
          Retrieve the underlying SQLDialect
 SQLDataType<T> getSQLDataType()
          Get the standard SQL data type of this (dialect-specific) data type if available.
 int getSQLType()
          Get JDBC Types value
 Class<? extends T> getType()
          Retrieve the Java type associated with this data type
 Class<?> getType(int precision, int scale)
          Retrieve a Java type associated with this data type and precision/scale
 String getTypeName()
          Retrieve the dialect-specific type name associated with this data type
 String getTypeName(Configuration configuration)
          Retrieve the dialect-specific type name associated with this data type
 boolean isArray()
          Whether this data type is an array type.
 boolean isBinary()
          Whether this data type is any binary type.
 boolean isDateTime()
          Whether this data type is any date or time type.
 boolean isInterval()
          Whether this data type is any interval type.
 boolean isLob()
          Whether this data type is best deserialised as a LOB.
 boolean isNumeric()
          Whether this data type is any numeric data type.
 boolean isString()
          Whether this data type is any character data type.
 boolean isTemporal()
          Whether this data type is any date or time type.
 

Method Detail

getSQLDataType

SQLDataType<T> getSQLDataType()
Get the standard SQL data type of this (dialect-specific) data type if available.


getDataType

DataType<T> getDataType(Configuration configuration)
The dialect-specific data type representing this data type.


getSQLType

int getSQLType()
Get JDBC Types value


getType

Class<? extends T> getType()
Retrieve the Java type associated with this data type


getType

Class<?> getType(int precision,
                 int scale)
Retrieve a Java type associated with this data type and precision/scale


getArrayType

Class<? extends T[]> getArrayType()
Retrieve the Java type associated with ARRAYs of this data type


getArrayDataType

DataType<T[]> getArrayDataType()
Retrieve the data type for an ARRAY of this data type


asArrayDataType

<A extends ArrayRecord<T>> DataType<A> asArrayDataType(Class<A> arrayDataType)
Retrieve the data type for an Oracle-style ARRAY of this data type


asMasterDataType

@Deprecated
<M extends MasterDataType<T>> DataType<M> asMasterDataType(Class<M> masterDataType)
Deprecated. - 2.5.0 [#1741] - This feature will be removed as of jOOQ 3.0

Retrieve the data type for a given master data type


asEnumDataType

<E extends EnumType> DataType<E> asEnumDataType(Class<E> enumDataType)
Retrieve the data type for a given enum data type


asConvertedDataType

<U> DataType<U> asConvertedDataType(Converter<? super T,U> converter)
Retrieve the data type for a given converter


getTypeName

String getTypeName()
Retrieve the dialect-specific type name associated with this data type


getTypeName

String getTypeName(Configuration configuration)
Retrieve the dialect-specific type name associated with this data type


getCastTypeName

String getCastTypeName()
Retrieve the dialect-specific type name associated with this data type used for casting

This is useful for some dialects that have specialised type names for cast expressions. Other dialects require type-length binding when casting, (e.g. VARCHAR(32767))


getCastTypeName

String getCastTypeName(Configuration configuration)
Retrieve the dialect-specific type name associated with this data type used for casting

This is useful for some dialects that have specialised type names for cast expressions. Other dialects require type-length binding when casting, (e.g. VARCHAR(32767))


getCastTypeName

String getCastTypeName(Configuration configuration,
                       int length)
Retrieve the dialect-specific type name associated with this data type used for casting

This is useful for some dialects that have specialised type names for cast expressions. Other dialects require type-length binding when casting, (e.g. VARCHAR(20))


getCastTypeName

String getCastTypeName(Configuration configuration,
                       int precision,
                       int scale)
Retrieve the dialect-specific type name associated with this data type used for casting

This is useful for some dialects that have specialised type names for cast expressions. Other dialects require type-length binding when casting, (e.g. DECIMAL(20,5))


getDialect

SQLDialect getDialect()
Retrieve the underlying SQLDialect


convert

T convert(Object object)
Convert an arbitrary object into <T>

Parameters:
object - The object to be converted
Returns:
The converted object
Throws:
DataTypeException - If conversion fails.

convert

T[] convert(Object... objects)
Convert an arbitrary set of objects into <T>

Parameters:
objects - The objects to be converted
Returns:
The converted objects
Throws:
DataTypeException - If conversion fails.

convert

List<T> convert(Collection<?> objects)
Convert an arbitrary set of objects into <T>

Parameters:
objects - The objects to be converted
Returns:
The converted objects
Throws:
DataTypeException - If conversion fails.

isNumeric

boolean isNumeric()
Whether this data type is any numeric data type.

This applies to any of these types:


isString

boolean isString()
Whether this data type is any character data type.

This applies to any of these types:


isDateTime

boolean isDateTime()
Whether this data type is any date or time type.

This applies to any of these types.


isTemporal

boolean isTemporal()
Whether this data type is any date or time type.

This applies to any of these types.

This is a combination of isDateTime() or isInterval()


isInterval

boolean isInterval()
Whether this data type is any interval type.

This applies to any of these types.


isBinary

boolean isBinary()
Whether this data type is any binary type.

This applies to any of these types.


isLob

boolean isLob()
Whether this data type is best deserialised as a LOB.

This applies to any of these types.


isArray

boolean isArray()
Whether this data type is an array type.



Copyright © 2012. All Rights Reserved.