Module org.jooq
Package org.jooq.impl

Class SQLDataType

java.lang.Object
org.jooq.impl.SQLDataType

public final class SQLDataType extends Object
The SQL standard data types, as described in Types.

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 Details

    • VARCHAR

      public static final DataType<String> VARCHAR
      The Types.VARCHAR type.
    • CHAR

      public static final DataType<String> CHAR
      The Types.CHAR type.
    • LONGVARCHAR

      public static final DataType<String> LONGVARCHAR
    • CLOB

      public static final DataType<String> CLOB
      The Types.CLOB type.
    • NVARCHAR

      public static final DataType<String> NVARCHAR
      The Types.NVARCHAR type.
    • NCHAR

      public static final DataType<String> NCHAR
      The Types.NCHAR type.
    • LONGNVARCHAR

      public static final DataType<String> LONGNVARCHAR
    • NCLOB

      public static final DataType<String> NCLOB
      The Types.NCLOB type.
    • BOOLEAN

      public static final DataType<Boolean> BOOLEAN
      The Types.BOOLEAN type.
    • BIT

      public static final DataType<Boolean> BIT
      The Types.BIT type.
    • TINYINT

      public static final DataType<Byte> TINYINT
      The Types.TINYINT type.
    • SMALLINT

      public static final DataType<Short> SMALLINT
      The Types.SMALLINT type.
    • INTEGER

      public static final DataType<Integer> INTEGER
      The Types.INTEGER type.
    • BIGINT

      public static final DataType<Long> BIGINT
      The Types.BIGINT type.
    • DECIMAL_INTEGER

      public static final DataType<BigInteger> DECIMAL_INTEGER
      The zero-scale Types.DECIMAL type.
    • TINYINTUNSIGNED

      public static final DataType<UByte> TINYINTUNSIGNED
      The unsigned Types.TINYINT type.
    • SMALLINTUNSIGNED

      public static final DataType<UShort> SMALLINTUNSIGNED
      The unsigned Types.SMALLINT type.
    • INTEGERUNSIGNED

      public static final DataType<UInteger> INTEGERUNSIGNED
      The unsigned Types.INTEGER type.
    • BIGINTUNSIGNED

      public static final DataType<ULong> BIGINTUNSIGNED
      The unsigned Types.BIGINT type.
    • DOUBLE

      public static final DataType<Double> DOUBLE
      The Types.DOUBLE type.
    • FLOAT

      public static final DataType<Double> FLOAT
      The Types.FLOAT type.
    • REAL

      public static final DataType<Float> REAL
      The Types.REAL type.
    • NUMERIC

      public static final DataType<BigDecimal> NUMERIC
      The Types.NUMERIC type.
    • DECIMAL

      public static final DataType<BigDecimal> DECIMAL
      The Types.DECIMAL type.
    • DATE

      public static final DataType<Date> DATE
      The Types.DATE type.
    • TIMESTAMP

      public static final DataType<Timestamp> TIMESTAMP
      The Types.TIMESTAMP type.
    • TIME

      public static final DataType<Time> TIME
      The Types.TIME type.
    • INTERVAL

      public static final DataType<YearToSecond> INTERVAL
      A vendor specific INTERVAL YEAR TO SECOND data type, which combines INTERVALYEARTOMONTH and INTERVALDAYTOSECOND.

      If you want to opt out of code generation support for this type, you can specify /configuration/generator/generate/intervalTypes to false.

    • INTERVALYEARTOMONTH

      public static final DataType<YearToMonth> INTERVALYEARTOMONTH
      The SQL standard INTERVAL YEAR TO MONTH data type.

      If you want to opt out of code generation support for this type, you can specify /configuration/generator/generate/intervalTypes to false.

    • INTERVALDAYTOSECOND

      public static final DataType<DayToSecond> INTERVALDAYTOSECOND
      The SQL standard INTERVAL DAY TO SECOND data type.

      If you want to opt out of code generation support for this type, you can specify /configuration/generator/generate/intervalTypes to false.

    • LOCALDATE

      public static final DataType<LocalDate> LOCALDATE
      The Types.DATE type.
    • LOCALTIME

      public static final DataType<LocalTime> LOCALTIME
      The Types.TIME type.
    • LOCALDATETIME

      public static final DataType<LocalDateTime> LOCALDATETIME
      The Types.TIMESTAMP type.
    • OFFSETTIME

      public static final DataType<OffsetTime> OFFSETTIME
      The Types.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 in OffsetDateTime). 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
      The Types.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 in OffsetDateTime). 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
      The Types.TIME_WITH_TIMEZONE type.

      An alias for OFFSETTIME

    • TIMESTAMPWITHTIMEZONE

      public static final DataType<OffsetDateTime> TIMESTAMPWITHTIMEZONE
    • INSTANT

      public static final DataType<Instant> INSTANT
      A Types.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's TIMESTAMP 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.

    • YEAR

      public static final DataType<Year> YEAR
      A Types.SMALLINT type that represents a year.

      While JDBC does not support this type, some dialects do, specifically those of the SQLDialectCategory.MYSQL category.

    • BINARY

      public static final DataType<byte[]> BINARY
      The Types.BINARY type.
    • VARBINARY

      public static final DataType<byte[]> VARBINARY
      The Types.VARBINARY type.
    • LONGVARBINARY

      public static final DataType<byte[]> LONGVARBINARY
    • BLOB

      public static final DataType<byte[]> BLOB
      The Types.BLOB type.
    • OTHER

      public static final DataType<Object> OTHER
      The Types.OTHER type.
    • ROWID

      public static final DataType<RowId> ROWID
      The Types.ROWID type.
    • RECORD

      public static final DataType<Record> RECORD
      The Types.STRUCT type.
    • RESULT

      public static final DataType<Result<Record>> RESULT
      The ResultSet type.

      This is not a JDBC standard. This type emulates REF CURSOR types and similar constructs

    • UUID

      public static final DataType<UUID> UUID
      The UUID type.

      This is not a JDBC standard. This type handles UUID types where they are supported

    • JSON

      public static final DataType<JSON> JSON
      The JSON type.

      This is not a JDBC standard. This type handles JSON types where they are supported.

      If you want to opt out of code generation support for this type, you can specify /configuration/generator/generate/jsonTypes to false.

    • JSONB

      public static final DataType<JSONB> JSONB
      The JSONB type.

      This is not a JDBC standard. This type handles JSONB types where they are supported.

      If you want to opt out of code generation support for this type, you can specify /configuration/generator/generate/jsonTypes to false.

    • XML

      public static final DataType<XML> XML
      The XML type.

      This is not a JDBC standard. This type handles XML types where they are supported.

      If you want to opt out of code generation support for this type, you can specify /configuration/generator/generate/xmlTypes to false.

    • GEOGRAPHY

      public static final DataType<Geography> GEOGRAPHY
      The Geography type.

      This is not a JDBC standard. This type handles spatial types where they are supported.

      If you want to opt out of code generation support for this type, you can specify /configuration/generator/generate/spatialTypes to false.

      This data type is supported only by the commercial editions of jOOQ.

    • GEOMETRY

      public static final DataType<Geometry> GEOMETRY
      The Geometry type.

      This is not a JDBC standard. This type handles spatial types where they are supported.

      If you want to opt out of code generation support for this type, you can specify /configuration/generator/generate/spatialTypes to false.

      This data type is supported only by the commercial editions of jOOQ.

    • DECFLOAT

      public static final DataType<Decfloat> DECFLOAT
      The Decfloat type.

      This is not a JDBC standard. This type handles DECFLOAT types where they are supported.

      If you want to opt out of code generation support for this type, you can specify /configuration/generator/generate/decfloatTypes to false.

  • Method Details