public abstract class AbstractDataType<T> extends Object implements DataType<T>
This also acts as a static data type registry for jOOQ internally.
This type is for JOOQ INTERNAL USE only. Do not reference directly
Modifier | Constructor and Description |
---|---|
protected |
AbstractDataType(SQLDialect dialect,
SQLDataType<T> sqldatatype,
Class<? extends T> type,
String typeName) |
protected |
AbstractDataType(SQLDialect dialect,
SQLDataType<T> sqldatatype,
Class<? extends T> type,
String typeName,
boolean hasPrecisionAndScale) |
protected |
AbstractDataType(SQLDialect dialect,
SQLDataType<T> sqldatatype,
Class<? extends T> type,
String typeName,
String castTypeName) |
protected |
AbstractDataType(SQLDialect dialect,
SQLDataType<T> sqlDataType,
Class<? extends T> type,
String typeName,
String castTypeName,
boolean hasPrecisionAndScale) |
Modifier and Type | Method and Description |
---|---|
<A extends ArrayRecord<T>> |
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> |
asEnumDataType(Class<E> enumDataType)
Retrieve the data type for a given enum data type
|
<M extends MasterDataType<T>> |
asMasterDataType(Class<M> masterDataType)
Retrieve the data type for a given master data type
|
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> |
boolean |
equals(Object obj) |
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.
|
protected static <T> DataType<T> |
getDataType(SQLDialect dialect,
Class<? extends T> type) |
protected static DataType<?> |
getDataType(SQLDialect dialect,
String typeName) |
protected static DataType<Object> |
getDefaultDataType(SQLDialect dialect,
String typeName) |
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
|
int |
hashCode() |
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.
|
String |
toString() |
protected AbstractDataType(SQLDialect dialect, SQLDataType<T> sqldatatype, Class<? extends T> type, String typeName)
protected AbstractDataType(SQLDialect dialect, SQLDataType<T> sqldatatype, Class<? extends T> type, String typeName, String castTypeName)
protected AbstractDataType(SQLDialect dialect, SQLDataType<T> sqldatatype, Class<? extends T> type, String typeName, boolean hasPrecisionAndScale)
protected AbstractDataType(SQLDialect dialect, SQLDataType<T> sqlDataType, Class<? extends T> type, String typeName, String castTypeName, boolean hasPrecisionAndScale)
public final SQLDataType<T> getSQLDataType()
DataType
getSQLDataType
in interface DataType<T>
public final DataType<T> getDataType(Configuration configuration)
DataType
getDataType
in interface DataType<T>
public int getSQLType()
DataType
Types
valuegetSQLType
in interface DataType<T>
public final Class<? extends T> getType()
DataType
public final Class<?> getType(int precision, int scale)
DataType
public final Class<? extends T[]> getArrayType()
DataType
getArrayType
in interface DataType<T>
public final String getTypeName()
DataType
getTypeName
in interface DataType<T>
public String getTypeName(Configuration configuration)
DataType
getTypeName
in interface DataType<T>
public final String getCastTypeName()
DataType
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
in interface DataType<T>
public String getCastTypeName(Configuration configuration, int length)
DataType
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
in interface DataType<T>
public String getCastTypeName(Configuration configuration, int precision, int scale)
DataType
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))
getCastTypeName
in interface DataType<T>
public String getCastTypeName(Configuration configuration)
DataType
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
in interface DataType<T>
public final DataType<T[]> getArrayDataType()
DataType
getArrayDataType
in interface DataType<T>
public final <A extends ArrayRecord<T>> DataType<A> asArrayDataType(Class<A> arrayDataType)
DataType
asArrayDataType
in interface DataType<T>
public final <M extends MasterDataType<T>> DataType<M> asMasterDataType(Class<M> masterDataType)
DataType
asMasterDataType
in interface DataType<T>
public final <E extends EnumType> DataType<E> asEnumDataType(Class<E> enumDataType)
DataType
asEnumDataType
in interface DataType<T>
public final <U> DataType<U> asConvertedDataType(Converter<? super T,U> converter)
DataType
asConvertedDataType
in interface DataType<T>
public final SQLDialect getDialect()
DataType
SQLDialect
getDialect
in interface DataType<T>
public T convert(Object object)
DataType
<T>
public final T[] convert(Object... objects)
DataType
<T>
public final List<T> convert(Collection<?> objects)
DataType
<T>
protected static DataType<Object> getDefaultDataType(SQLDialect dialect, String typeName)
protected static DataType<?> getDataType(SQLDialect dialect, String typeName)
protected static <T> DataType<T> getDataType(SQLDialect dialect, Class<? extends T> type)
public final boolean isNumeric()
DataType
This applies to any of these types:
public final boolean isString()
DataType
This applies to any of these types:
public final boolean isDateTime()
DataType
This applies to any of these types.
isDateTime
in interface DataType<T>
public final boolean isTemporal()
DataType
This applies to any of these types.
This is a combination of DataType.isDateTime()
or DataType.isInterval()
isTemporal
in interface DataType<T>
public final boolean isInterval()
DataType
This applies to any of these types.
isInterval
in interface DataType<T>
public final boolean isLob()
DataType
LOB
.
This applies to any of these types.
public final boolean isBinary()
DataType
This applies to any of these types.
public final boolean isArray()
DataType
Copyright © 2013. All Rights Reserved.