T
- The Java type associated with this SQL data typepublic interface DataType<T> extends Serializable
Modifier and Type | Method and Description |
---|---|
<A extends ArrayRecord<?>> |
asArrayDataType(Class<A> arrayDataType)
Retrieve the data type for an Oracle-style ARRAY of this data type.
|
<U> DataType<U> |
asConvertedDataType(Binding<? super T,U> binding)
Retrieve the data type for a given binding.
|
<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> . |
boolean |
defaulted()
Get the defaultability of this data type.
|
DataType<T> |
defaulted(boolean defaulted)
Deprecated.
- [#3852] - 3.8.0 - Use
defaultValue(Field) instead. |
Field<T> |
defaultValue()
The expression to be applied as the
DEFAULT value for this
data type. |
DataType<T> |
defaultValue(Field<T> defaultValue)
Specify an expression to be applied as the
DEFAULT value for
this data type. |
DataType<T> |
defaultValue(T defaultValue)
Specify an expression to be applied as the
DEFAULT value for
this data type. |
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.
|
Binding<?,T> |
getBinding()
Get the data type binding associated with this data type.
|
String |
getCastTypeName()
Retrieve the dialect-specific type name associated with this data type
used for casting.
|
String |
getCastTypeName(Configuration configuration)
Retrieve the dialect-specific type name associated with this data type
used for casting.
|
Converter<?,T> |
getConverter()
Get the converter associated with this data type.
|
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.
|
boolean |
nullable()
Get the nullability of this data type.
|
DataType<T> |
nullable(boolean nullable)
Return a new data type like this, with a new nullability.
|
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.
|
DataType<T> |
precision(int precision,
int scale)
Return a new data type like this, with a new precision and scale value.
|
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.
|
DataType<T> getSQLDataType()
DataType<T> getDataType(Configuration configuration)
int getSQLType()
Types
value.Class<T[]> getArrayType()
DataType<T[]> getArrayDataType()
<A extends ArrayRecord<?>> DataType<A> asArrayDataType(Class<A> arrayDataType)
<E extends EnumType> DataType<E> asEnumDataType(Class<E> enumDataType)
<U> DataType<U> asConvertedDataType(Converter<? super T,U> converter)
<U> DataType<U> asConvertedDataType(Binding<? super T,U> binding)
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()
SQLDialect
.T convert(Object object)
<T>
.
See Convert.convert(Object, Class)
for details about conversion rules.
object
- The object to be convertedDataTypeException
- If conversion fails.T[] convert(Object... objects)
<T>
.
See Convert.convert(Object, Class)
for details about conversion rules.
objects
- The objects to be convertedDataTypeException
- If conversion fails.List<T> convert(Collection<?> objects)
<T>
.
See Convert.convert(Object, Class)
for details about conversion rules.
objects
- The objects to be convertedDataTypeException
- If conversion fails.DataType<T> nullable(boolean nullable)
nullable
- The new nullabilityboolean nullable()
DataType<T> defaultValue(T defaultValue)
DEFAULT
value for
this data type.defaultValue(Field)
DataType<T> defaultValue(Field<T> defaultValue)
DEFAULT
value for
this data type.
A default value of a data type applies to DDL statements, such as
CREATE TABLE
ALTER TABLE
The distinct types of possible DEFAULT
expressions is
defined by the underlying database. Please refer to your database manual
to learn what expressions are possible.
Field<T> defaultValue()
DEFAULT
value for this
data type.null
if no default
value is specified for this data type.defaultValue(Field)
@Deprecated DataType<T> defaulted(boolean defaulted)
defaultValue(Field)
instead.defaulted
- The new defaultabilityboolean defaulted()
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.
SQLDataType.DATE
SQLDataType.TIME
SQLDataType.TIMESTAMP
SQLDataType.LOCALDATE
SQLDataType.LOCALTIME
SQLDataType.LOCALDATETIME
SQLDataType.OFFSETTIME
SQLDataType.OFFSETDATETIME
YearToMonth
DayToSecond
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 © 2017. All Rights Reserved.