- 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.BINARYtype.static DataType<byte[]>BLOB(int length)TheTypes.BLOBtype.static DataType<String>CHAR(int length)TheTypes.CHARtype.static DataType<String>CLOB(int length)TheTypes.CLOBtype.static DataType<BigDecimal>DECIMAL(int precision)TheTypes.DECIMALtype.static DataType<BigDecimal>DECIMAL(int precision, int scale)TheTypes.DECIMALtype.static DataType<BigInteger>DECIMAL_INTEGER(int precision)The zero-scaleTypes.DECIMALtype.static DataType<Instant>INSTANT(int precision)ATypes.TIMESTAMP_WITH_TIMEZONEtype that uses UTC as time zone.static DataType<String>LONGNVARCHAR(int length)TheTypes.LONGNVARCHARtype.static DataType<byte[]>LONGVARBINARY(int length)TheTypes.LONGVARBINARYtype.static DataType<String>LONGVARCHAR(int length)TheTypes.LONGVARCHARtype.static DataType<String>NCHAR(int length)TheTypes.NCHARtype.static DataType<String>NCLOB(int length)TheTypes.NCLOBtype.static DataType<BigDecimal>NUMERIC(int precision)TheTypes.NUMERICtype.static DataType<BigDecimal>NUMERIC(int precision, int scale)TheTypes.NUMERICtype.static DataType<String>NVARCHAR(int length)TheTypes.NVARCHARtype.static DataType<OffsetDateTime>OFFSETDATETIME(int precision)TheTypes.TIMESTAMP_WITH_TIMEZONEtype.static DataType<OffsetTime>OFFSETTIME(int precision)TheTypes.TIME_WITH_TIMEZONEtype.static DataType<Time>TIME(int precision)TheTypes.TIMEtype.static DataType<Timestamp>TIMESTAMP(int precision)TheTypes.TIMESTAMPtype.static DataType<OffsetDateTime>TIMESTAMPWITHTIMEZONE(int precision)TheTypes.TIMESTAMP_WITH_TIMEZONEtype.static DataType<OffsetTime>TIMEWITHTIMEZONE(int precision)TheTypes.TIME_WITH_TIMEZONEtype.static DataType<byte[]>VARBINARY(int length)TheTypes.VARBINARYtype.static DataType<String>VARCHAR(int length)TheTypes.VARCHARtype.
-
-
-
Field Detail
-
VARCHAR
public static final DataType<String> VARCHAR
TheTypes.VARCHARtype.
-
CHAR
public static final DataType<String> CHAR
TheTypes.CHARtype.
-
LONGVARCHAR
public static final DataType<String> LONGVARCHAR
TheTypes.LONGVARCHARtype.
-
CLOB
public static final DataType<String> CLOB
TheTypes.CLOBtype.
-
NVARCHAR
public static final DataType<String> NVARCHAR
TheTypes.NVARCHARtype.
-
NCHAR
public static final DataType<String> NCHAR
TheTypes.NCHARtype.
-
LONGNVARCHAR
public static final DataType<String> LONGNVARCHAR
TheTypes.LONGNVARCHARtype.
-
NCLOB
public static final DataType<String> NCLOB
TheTypes.NCLOBtype.
-
BOOLEAN
public static final DataType<Boolean> BOOLEAN
TheTypes.BOOLEANtype.
-
TINYINT
public static final DataType<Byte> TINYINT
TheTypes.TINYINTtype.
-
SMALLINT
public static final DataType<Short> SMALLINT
TheTypes.SMALLINTtype.
-
INTEGER
public static final DataType<Integer> INTEGER
TheTypes.INTEGERtype.
-
BIGINT
public static final DataType<Long> BIGINT
TheTypes.BIGINTtype.
-
DECIMAL_INTEGER
public static final DataType<BigInteger> DECIMAL_INTEGER
The zero-scaleTypes.DECIMALtype.
-
TINYINTUNSIGNED
public static final DataType<UByte> TINYINTUNSIGNED
The unsignedTypes.TINYINTtype.
-
SMALLINTUNSIGNED
public static final DataType<UShort> SMALLINTUNSIGNED
The unsignedTypes.SMALLINTtype.
-
INTEGERUNSIGNED
public static final DataType<UInteger> INTEGERUNSIGNED
The unsignedTypes.INTEGERtype.
-
BIGINTUNSIGNED
public static final DataType<ULong> BIGINTUNSIGNED
The unsignedTypes.BIGINTtype.
-
DOUBLE
public static final DataType<Double> DOUBLE
TheTypes.DOUBLEtype.
-
FLOAT
public static final DataType<Double> FLOAT
TheTypes.FLOATtype.
-
REAL
public static final DataType<Float> REAL
TheTypes.REALtype.
-
NUMERIC
public static final DataType<BigDecimal> NUMERIC
TheTypes.NUMERICtype.
-
DECIMAL
public static final DataType<BigDecimal> DECIMAL
TheTypes.DECIMALtype.
-
DATE
public static final DataType<Date> DATE
TheTypes.DATEtype.
-
TIMESTAMP
public static final DataType<Timestamp> TIMESTAMP
TheTypes.TIMESTAMPtype.
-
TIME
public static final DataType<Time> TIME
TheTypes.TIMEtype.
-
INTERVAL
public static final DataType<YearToSecond> INTERVAL
A vendor specificINTERVAL YEAR TO SECONDdata type, which combinesINTERVALYEARTOMONTHandINTERVALDAYTOSECOND.
-
INTERVALYEARTOMONTH
public static final DataType<YearToMonth> INTERVALYEARTOMONTH
The SQL standardINTERVAL YEAR TO MONTHdata type.
-
INTERVALDAYTOSECOND
public static final DataType<DayToSecond> INTERVALDAYTOSECOND
The SQL standardINTERVAL DAY TO SECONDdata type.
-
LOCALDATE
public static final DataType<LocalDate> LOCALDATE
TheTypes.DATEtype.
-
LOCALTIME
public static final DataType<LocalTime> LOCALTIME
TheTypes.TIMEtype.
-
LOCALDATETIME
public static final DataType<LocalDateTime> LOCALDATETIME
TheTypes.TIMESTAMPtype.
-
OFFSETTIME
public static final DataType<OffsetTime> OFFSETTIME
TheTypes.TIME_WITH_TIMEZONEtype.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_TIMEZONEtype.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_TIMEZONEtype.An alias for
OFFSETTIME
-
TIMESTAMPWITHTIMEZONE
public static final DataType<OffsetDateTime> TIMESTAMPWITHTIMEZONE
TheTypes.TIMESTAMP_WITH_TIMEZONEtype.An alias for
OFFSETDATETIME
-
INSTANT
public static final DataType<Instant> INSTANT
ATypes.TIMESTAMP_WITH_TIMEZONEtype that uses UTC as time zone.Neither JDBC, nor most SQL databases support the
INSTANTdata 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 ZONEdata 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.BINARYtype.
-
VARBINARY
public static final DataType<byte[]> VARBINARY
TheTypes.VARBINARYtype.
-
LONGVARBINARY
public static final DataType<byte[]> LONGVARBINARY
TheTypes.LONGVARBINARYtype.
-
BLOB
public static final DataType<byte[]> BLOB
TheTypes.BLOBtype.
-
OTHER
public static final DataType<Object> OTHER
TheTypes.OTHERtype.
-
ROWID
public static final DataType<RowId> ROWID
TheTypes.ROWIDtype.
-
RECORD
public static final DataType<Record> RECORD
TheTypes.STRUCTtype.
-
RESULT
public static final DataType<Result<Record>> RESULT
TheResultSettype.This is not a SQL or JDBC standard. This type emulates REF CURSOR types and similar constructs
-
UUID
public static final DataType<UUID> UUID
TheUUIDtype.This is not a SQL or JDBC standard. This type handles UUID types where they are supported
-
JSON
public static final DataType<JSON> JSON
TheJSONtype.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.VARCHARtype.
-
CHAR
public static final DataType<String> CHAR(int length)
TheTypes.CHARtype.
-
LONGVARCHAR
public static final DataType<String> LONGVARCHAR(int length)
TheTypes.LONGVARCHARtype.
-
CLOB
public static final DataType<String> CLOB(int length)
TheTypes.CLOBtype.
-
NVARCHAR
public static final DataType<String> NVARCHAR(int length)
TheTypes.NVARCHARtype.
-
NCHAR
public static final DataType<String> NCHAR(int length)
TheTypes.NCHARtype.
-
LONGNVARCHAR
public static final DataType<String> LONGNVARCHAR(int length)
TheTypes.LONGNVARCHARtype.
-
NCLOB
public static final DataType<String> NCLOB(int length)
TheTypes.NCLOBtype.
-
DECIMAL_INTEGER
public static final DataType<BigInteger> DECIMAL_INTEGER(int precision)
The zero-scaleTypes.DECIMALtype.
-
NUMERIC
public static final DataType<BigDecimal> NUMERIC(int precision)
TheTypes.NUMERICtype.
-
NUMERIC
public static final DataType<BigDecimal> NUMERIC(int precision, int scale)
TheTypes.NUMERICtype.
-
DECIMAL
public static final DataType<BigDecimal> DECIMAL(int precision)
TheTypes.DECIMALtype.
-
DECIMAL
public static final DataType<BigDecimal> DECIMAL(int precision, int scale)
TheTypes.DECIMALtype.
-
TIMESTAMP
public static final DataType<Timestamp> TIMESTAMP(int precision)
TheTypes.TIMESTAMPtype.
-
TIME
public static final DataType<Time> TIME(int precision)
TheTypes.TIMEtype.
-
OFFSETTIME
public static final DataType<OffsetTime> OFFSETTIME(int precision)
TheTypes.TIME_WITH_TIMEZONEtype.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_TIMEZONEtype.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_TIMEZONEtype.An alias for
OFFSETTIME
-
TIMESTAMPWITHTIMEZONE
public static final DataType<OffsetDateTime> TIMESTAMPWITHTIMEZONE(int precision)
TheTypes.TIMESTAMP_WITH_TIMEZONEtype.An alias for
OFFSETDATETIME
-
INSTANT
public static final DataType<Instant> INSTANT(int precision)
ATypes.TIMESTAMP_WITH_TIMEZONEtype that uses UTC as time zone.Neither JDBC, nor most SQL databases support the
INSTANTdata 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 ZONEdata 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.BINARYtype.
-
VARBINARY
public static final DataType<byte[]> VARBINARY(int length)
TheTypes.VARBINARYtype.
-
LONGVARBINARY
public static final DataType<byte[]> LONGVARBINARY(int length)
TheTypes.LONGVARBINARYtype.
-
BLOB
public static final DataType<byte[]> BLOB(int length)
TheTypes.BLOBtype.
-
-