T - The Java type associated with this SQL data typepublic interface DataType<T> extends Serializable
| 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
|
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<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.
|
DataType<T> |
getDataType(Configuration configuration)
The dialect-specific data type representing this data type.
|
SQLDialect |
getDialect()
Retrieve the underlying
SQLDialect |
DataType<T> |
getSQLDataType()
Get the standard SQL data type of this (dialect-specific) data type if
available.
|
int |
getSQLType()
Get JDBC
Types value |
Class<T> |
getType()
Retrieve the Java type associated with this data type
|
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 |
hasLength()
Whether this data type has a length
|
boolean |
hasPrecision()
Whether this data type has a precision
|
boolean |
hasScale()
Whether this data type has a scale
|
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.
|
int |
length()
Get the length of this data type
|
DataType<T> |
length(int length)
Return a new data type like this, with a new length value
This will have no effect if
hasLength() is false |
int |
precision()
Get the precision of this data type
|
DataType<T> |
precision(int precision)
Return a new data type like this, with a new precision value
This will have no effect if
hasPrecision() is false
This is the same as calling precision(int, int) with
scale == 0 |
DataType<T> |
precision(int precision,
int scale)
Return a new data type like this, with a new precision and scale value
This will have no effect if
hasPrecision() is false
, or if scale > 0 and hasScale() is
false |
int |
scale()
Get the scale of this data type
|
DataType<T> |
scale(int scale)
Return a new data type like this, with a new scale value
This will have no effect if
hasScale() is false |
DataType<T> getSQLDataType()
DataType<T> getDataType(Configuration configuration)
int getSQLType()
Types valueClass<T[]> getArrayType()
DataType<T[]> getArrayDataType()
<A extends ArrayRecord<T>> DataType<A> asArrayDataType(Class<A> arrayDataType)
<E extends EnumType> DataType<E> asEnumDataType(Class<E> enumDataType)
<U> DataType<U> asConvertedDataType(Converter<? super T,U> converter)
String getTypeName()
String getTypeName(Configuration configuration)
String getCastTypeName()
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))
String getCastTypeName(Configuration configuration)
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))
SQLDialect getDialect()
SQLDialectT convert(Object object)
<T>object - The object to be convertedDataTypeException - If conversion fails.T[] convert(Object... objects)
<T>objects - The objects to be convertedDataTypeException - If conversion fails.List<T> convert(Collection<?> objects)
<T>objects - The objects to be convertedDataTypeException - If conversion fails.DataType<T> precision(int precision)
This will have no effect if hasPrecision() is false
This is the same as calling precision(int, int) with
scale == 0
precision - The new precision valueDataType<T> precision(int precision, int scale)
This will have no effect if hasPrecision() is false
, or if scale > 0 and hasScale() is
false
precision - The new precision valuescale - The new scale valueint precision()
boolean hasPrecision()
DataType<T> scale(int scale)
This will have no effect if hasScale() is false
scale - The new scale valueint scale()
boolean hasScale()
DataType<T> length(int length)
This will have no effect if hasLength() is false
length - The new length valueint length()
boolean hasLength()
boolean isNumeric()
This applies to any of these types:
boolean isString()
This applies to any of these types:
boolean isDateTime()
This applies to any of these types.
boolean isTemporal()
This applies to any of these types.
This is a combination of isDateTime() or isInterval()
boolean isInterval()
This applies to any of these types.
boolean isBinary()
This applies to any of these types.
boolean isLob()
LOB.
This applies to any of these types.
boolean isArray()
Copyright © 2013. All Rights Reserved.