- java.lang.Object
-
- org.jooq.impl.SQLDataType
-
public final class SQLDataType extends Object
The SQL standard data types, as described inTypes
.These types are usually the ones that are referenced by generated source code. Most RDBMS have an almost 1:1 mapping between their vendor-specific types and the ones in this class (except Oracle). Some RDBMS also have extensions, e.g. for geospacial data types. See the dialect-specific data type classes for more information.
- Author:
- Lukas Eder
-
-
Field Summary
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static DataType<byte[]>
BINARY(int length)
TheTypes.BINARY
type.static DataType<byte[]>
BLOB(int length)
TheTypes.BLOB
type.static DataType<String>
CHAR(int length)
TheTypes.CHAR
type.static DataType<String>
CLOB(int length)
TheTypes.CLOB
type.static DataType<BigDecimal>
DECIMAL(int precision)
TheTypes.DECIMAL
type.static DataType<BigDecimal>
DECIMAL(int precision, int scale)
TheTypes.DECIMAL
type.static DataType<BigInteger>
DECIMAL_INTEGER(int precision)
The zero-scaleTypes.DECIMAL
type.static DataType<Instant>
INSTANT(int precision)
ATypes.TIMESTAMP_WITH_TIMEZONE
type that uses UTC as time zone.static DataType<String>
LONGNVARCHAR(int length)
TheTypes.LONGNVARCHAR
type.static DataType<byte[]>
LONGVARBINARY(int length)
TheTypes.LONGVARBINARY
type.static DataType<String>
LONGVARCHAR(int length)
TheTypes.LONGVARCHAR
type.static DataType<String>
NCHAR(int length)
TheTypes.NCHAR
type.static DataType<String>
NCLOB(int length)
TheTypes.NCLOB
type.static DataType<BigDecimal>
NUMERIC(int precision)
TheTypes.NUMERIC
type.static DataType<BigDecimal>
NUMERIC(int precision, int scale)
TheTypes.NUMERIC
type.static DataType<String>
NVARCHAR(int length)
TheTypes.NVARCHAR
type.static DataType<OffsetDateTime>
OFFSETDATETIME(int precision)
TheTypes.TIMESTAMP_WITH_TIMEZONE
type.static DataType<OffsetTime>
OFFSETTIME(int precision)
TheTypes.TIME_WITH_TIMEZONE
type.static DataType<Time>
TIME(int precision)
TheTypes.TIME
type.static DataType<Timestamp>
TIMESTAMP(int precision)
TheTypes.TIMESTAMP
type.static DataType<OffsetDateTime>
TIMESTAMPWITHTIMEZONE(int precision)
TheTypes.TIMESTAMP_WITH_TIMEZONE
type.static DataType<OffsetTime>
TIMEWITHTIMEZONE(int precision)
TheTypes.TIME_WITH_TIMEZONE
type.static DataType<byte[]>
VARBINARY(int length)
TheTypes.VARBINARY
type.static DataType<String>
VARCHAR(int length)
TheTypes.VARCHAR
type.
-
-
-
Field Detail
-
VARCHAR
public static final DataType<String> VARCHAR
TheTypes.VARCHAR
type.
-
CHAR
public static final DataType<String> CHAR
TheTypes.CHAR
type.
-
LONGVARCHAR
public static final DataType<String> LONGVARCHAR
TheTypes.LONGVARCHAR
type.
-
CLOB
public static final DataType<String> CLOB
TheTypes.CLOB
type.
-
NVARCHAR
public static final DataType<String> NVARCHAR
TheTypes.NVARCHAR
type.
-
NCHAR
public static final DataType<String> NCHAR
TheTypes.NCHAR
type.
-
LONGNVARCHAR
public static final DataType<String> LONGNVARCHAR
TheTypes.LONGNVARCHAR
type.
-
NCLOB
public static final DataType<String> NCLOB
TheTypes.NCLOB
type.
-
BOOLEAN
public static final DataType<Boolean> BOOLEAN
TheTypes.BOOLEAN
type.
-
TINYINT
public static final DataType<Byte> TINYINT
TheTypes.TINYINT
type.
-
SMALLINT
public static final DataType<Short> SMALLINT
TheTypes.SMALLINT
type.
-
INTEGER
public static final DataType<Integer> INTEGER
TheTypes.INTEGER
type.
-
BIGINT
public static final DataType<Long> BIGINT
TheTypes.BIGINT
type.
-
DECIMAL_INTEGER
public static final DataType<BigInteger> DECIMAL_INTEGER
The zero-scaleTypes.DECIMAL
type.
-
TINYINTUNSIGNED
public static final DataType<UByte> TINYINTUNSIGNED
The unsignedTypes.TINYINT
type.
-
SMALLINTUNSIGNED
public static final DataType<UShort> SMALLINTUNSIGNED
The unsignedTypes.SMALLINT
type.
-
INTEGERUNSIGNED
public static final DataType<UInteger> INTEGERUNSIGNED
The unsignedTypes.INTEGER
type.
-
BIGINTUNSIGNED
public static final DataType<ULong> BIGINTUNSIGNED
The unsignedTypes.BIGINT
type.
-
DOUBLE
public static final DataType<Double> DOUBLE
TheTypes.DOUBLE
type.
-
FLOAT
public static final DataType<Double> FLOAT
TheTypes.FLOAT
type.
-
REAL
public static final DataType<Float> REAL
TheTypes.REAL
type.
-
NUMERIC
public static final DataType<BigDecimal> NUMERIC
TheTypes.NUMERIC
type.
-
DECIMAL
public static final DataType<BigDecimal> DECIMAL
TheTypes.DECIMAL
type.
-
DATE
public static final DataType<Date> DATE
TheTypes.DATE
type.
-
TIMESTAMP
public static final DataType<Timestamp> TIMESTAMP
TheTypes.TIMESTAMP
type.
-
TIME
public static final DataType<Time> TIME
TheTypes.TIME
type.
-
INTERVAL
public static final DataType<YearToSecond> INTERVAL
The SQL standardINTERVAL YEAR TO SECOND
data type.
-
INTERVALYEARTOMONTH
public static final DataType<YearToMonth> INTERVALYEARTOMONTH
The SQL standardINTERVAL YEAR TO MONTH
data type.
-
INTERVALDAYTOSECOND
public static final DataType<DayToSecond> INTERVALDAYTOSECOND
The SQL standardINTERVAL DAY TO SECOND
data type.
-
LOCALDATE
public static final DataType<LocalDate> LOCALDATE
TheTypes.DATE
type.
-
LOCALTIME
public static final DataType<LocalTime> LOCALTIME
TheTypes.TIME
type.
-
LOCALDATETIME
public static final DataType<LocalDateTime> LOCALDATETIME
TheTypes.TIMESTAMP
type.
-
OFFSETTIME
public static final DataType<OffsetTime> OFFSETTIME
TheTypes.TIME_WITH_TIMEZONE
type.The behaviour of this data type is influenced by the JDBC driver and the database that is used. Some databases support actual time zones (as in
ZonedDateTime
), other databases support only offsets (as inOffsetDateTime
). Some databases retain the actual time zone information that is stored and reproduce it with every fetch (e.g.SQLDialect.ORACLE
), others use this type as a synonym for a timestamp in UTC (e.g.SQLDialect.POSTGRES
), producing possibly a value in the current time zone of the database or the client. Please refer to your database for more information about the behaviour of this data type.
-
OFFSETDATETIME
public static final DataType<OffsetDateTime> OFFSETDATETIME
TheTypes.TIMESTAMP_WITH_TIMEZONE
type.The behaviour of this data type is influenced by the JDBC driver and the database that is used. Some databases support actual time zones (as in
ZonedDateTime
), other databases support only offsets (as inOffsetDateTime
). Some databases retain the actual time zone information that is stored and reproduce it with every fetch (e.g.SQLDialect.ORACLE
), others use this type as a synonym for a timestamp in UTC (e.g.SQLDialect.POSTGRES
), producing possibly a value in the current time zone of the database or the client. Please refer to your database for more information about the behaviour of this data type.
-
TIMEWITHTIMEZONE
public static final DataType<OffsetTime> TIMEWITHTIMEZONE
TheTypes.TIME_WITH_TIMEZONE
type.An alias for
OFFSETTIME
-
TIMESTAMPWITHTIMEZONE
public static final DataType<OffsetDateTime> TIMESTAMPWITHTIMEZONE
TheTypes.TIMESTAMP_WITH_TIMEZONE
type.An alias for
OFFSETDATETIME
-
INSTANT
public static final DataType<Instant> INSTANT
ATypes.TIMESTAMP_WITH_TIMEZONE
type that uses UTC as time zone.Neither JDBC, nor most SQL databases support the
INSTANT
data type, which is often the only kind of timestamp which can be expected to behave across all server and client time zone settings. This implementation is backed by the database vendor'sTIMESTAMP WITH TIME ZONE
data type implementation, which may (e.g. Oracle) or may not (e.g. PostgreSQL) store the timestamp information. Irrespective of that storage, this type will always produce time zone agnostic instants in client code.
-
BINARY
public static final DataType<byte[]> BINARY
TheTypes.BINARY
type.
-
VARBINARY
public static final DataType<byte[]> VARBINARY
TheTypes.VARBINARY
type.
-
LONGVARBINARY
public static final DataType<byte[]> LONGVARBINARY
TheTypes.LONGVARBINARY
type.
-
BLOB
public static final DataType<byte[]> BLOB
TheTypes.BLOB
type.
-
OTHER
public static final DataType<Object> OTHER
TheTypes.OTHER
type.
-
ROWID
public static final DataType<RowId> ROWID
TheTypes.ROWID
type.
-
RECORD
public static final DataType<Record> RECORD
TheTypes.STRUCT
type.
-
RESULT
public static final DataType<Result<Record>> RESULT
TheResultSet
type.This is not a SQL or JDBC standard. This type emulates REF CURSOR types and similar constructs
-
UUID
public static final DataType<UUID> UUID
TheUUID
type.This is not a SQL or JDBC standard. This type handles UUID types where they are supported
-
JSON
public static final DataType<JSON> JSON
TheJSON
type.This is not a SQL or JDBC standard. This type handles JSON types where they are supported.
-
-
Method Detail
-
VARCHAR
public static final DataType<String> VARCHAR(int length)
TheTypes.VARCHAR
type.
-
CHAR
public static final DataType<String> CHAR(int length)
TheTypes.CHAR
type.
-
LONGVARCHAR
public static final DataType<String> LONGVARCHAR(int length)
TheTypes.LONGVARCHAR
type.
-
CLOB
public static final DataType<String> CLOB(int length)
TheTypes.CLOB
type.
-
NVARCHAR
public static final DataType<String> NVARCHAR(int length)
TheTypes.NVARCHAR
type.
-
NCHAR
public static final DataType<String> NCHAR(int length)
TheTypes.NCHAR
type.
-
LONGNVARCHAR
public static final DataType<String> LONGNVARCHAR(int length)
TheTypes.LONGNVARCHAR
type.
-
NCLOB
public static final DataType<String> NCLOB(int length)
TheTypes.NCLOB
type.
-
DECIMAL_INTEGER
public static final DataType<BigInteger> DECIMAL_INTEGER(int precision)
The zero-scaleTypes.DECIMAL
type.
-
NUMERIC
public static final DataType<BigDecimal> NUMERIC(int precision)
TheTypes.NUMERIC
type.
-
NUMERIC
public static final DataType<BigDecimal> NUMERIC(int precision, int scale)
TheTypes.NUMERIC
type.
-
DECIMAL
public static final DataType<BigDecimal> DECIMAL(int precision)
TheTypes.DECIMAL
type.
-
DECIMAL
public static final DataType<BigDecimal> DECIMAL(int precision, int scale)
TheTypes.DECIMAL
type.
-
TIMESTAMP
public static final DataType<Timestamp> TIMESTAMP(int precision)
TheTypes.TIMESTAMP
type.
-
TIME
public static final DataType<Time> TIME(int precision)
TheTypes.TIME
type.
-
OFFSETTIME
public static final DataType<OffsetTime> OFFSETTIME(int precision)
TheTypes.TIME_WITH_TIMEZONE
type.The behaviour of this data type is influenced by the JDBC driver and the database that is used. Some databases support actual time zones (as in
ZonedDateTime
), other databases support only offsets (as inOffsetDateTime
). Some databases retain the actual time zone information that is stored and reproduce it with every fetch (e.g.SQLDialect.ORACLE
), others use this type as a synonym for a timestamp in UTC (e.g.SQLDialect.POSTGRES
), producing possibly a value in the current time zone of the database or the client. Please refer to your database for more information about the behaviour of this data type.
-
OFFSETDATETIME
public static final DataType<OffsetDateTime> OFFSETDATETIME(int precision)
TheTypes.TIMESTAMP_WITH_TIMEZONE
type.The behaviour of this data type is influenced by the JDBC driver and the database that is used. Some databases support actual time zones (as in
ZonedDateTime
), other databases support only offsets (as inOffsetDateTime
). Some databases retain the actual time zone information that is stored and reproduce it with every fetch (e.g.SQLDialect.ORACLE
), others use this type as a synonym for a timestamp in UTC (e.g.SQLDialect.POSTGRES
), producing possibly a value in the current time zone of the database or the client. Please refer to your database for more information about the behaviour of this data type.
-
TIMEWITHTIMEZONE
public static final DataType<OffsetTime> TIMEWITHTIMEZONE(int precision)
TheTypes.TIME_WITH_TIMEZONE
type.An alias for
OFFSETTIME
-
TIMESTAMPWITHTIMEZONE
public static final DataType<OffsetDateTime> TIMESTAMPWITHTIMEZONE(int precision)
TheTypes.TIMESTAMP_WITH_TIMEZONE
type.An alias for
OFFSETDATETIME
-
INSTANT
public static final DataType<Instant> INSTANT(int precision)
ATypes.TIMESTAMP_WITH_TIMEZONE
type that uses UTC as time zone.Neither JDBC, nor most SQL databases support the
INSTANT
data type, which is often the only kind of timestamp which can be expected to behave across all server and client time zone settings. This implementation is backed by the database vendor'sTIMESTAMP WITH TIME ZONE
data type implementation, which may (e.g. Oracle) or may not (e.g. PostgreSQL) store the timestamp information. Irrespective of that storage, this type will always produce time zone agnostic instants in client code.
-
BINARY
public static final DataType<byte[]> BINARY(int length)
TheTypes.BINARY
type.
-
VARBINARY
public static final DataType<byte[]> VARBINARY(int length)
TheTypes.VARBINARY
type.
-
LONGVARBINARY
public static final DataType<byte[]> LONGVARBINARY(int length)
TheTypes.LONGVARBINARY
type.
-
BLOB
public static final DataType<byte[]> BLOB(int length)
TheTypes.BLOB
type.
-
-