Available in versions: Dev (3.21) | Latest (3.20) | 3.19 | 3.18 | 3.17 | 3.16 | 3.15 | 3.14 | 3.13 | 3.12 | 3.11
Data types
Supported by ✅ Open Source Edition ✅ Express Edition ✅ Professional Edition ✅ Enterprise Edition
In jOOQ, the column expression is represented by a Field<T>
type, where the T
type variable is derived from its Field.getDataType()
property. The org.jooq.DataType
API models the rich world of SQL data types. A DataType
models:
- A database type reference, such as VARCHAR or INTEGER
- A variety of flags modifying the type, such as precision, precision, scale, and many more.
- A Java representation of the database type reference, usually denoted as the
T
type variable (for "type"), e.g.java.lang.String
orjava.lang.Integer
- A Java representation of the user type reference, usually denoted as the
U
type variable (for "user type"), e.g.Email
if it's a custom data type. By default, this is the same asT
.
Data types include:
-
Built-in data types: These are types that are supported by the underlying RDBMS directly, such as VARCHAR or INTEGER. jOOQ's core library offers support for these out of the box, and can emulate some of them where not supported, e.g. UUID is just a
VARCHAR(36)
- Extended data types: These are also built-in data types, but very dialect specific, such that jOOQ's core library doesn't offer them out of the box.
- Enum data types: Some dialects support a special kind of constraint on VARCHAR style types, which allows only for certain enumerated values in the type.
-
Domain data types: The SQL standard specifies
DOMAIN
types to be a set of re-usable constraints on an existing data type, which is supported in numerous dialects. - User-defined data types: The SQL standard specifies user-defined types to be a number of refinements on existing types, or the creation of a object type. The latter is what a few ORDBMS, JBDC, and jOOQ support.
-
Converted data types: Any data type
T
of the above list can be converted to a user typeU
using a Converter and/or Binding, in order to change the user representation in Java code.
Table of contents
- 3.13.1.
- Flags modifying data types
- 3.13.1.1.
- Data type length
- 3.13.1.2.
- Data type precision
- 3.13.1.3.
- Data type scale
- 3.13.2.
- Built-in data types
- 3.13.2.1.
- BIGINT (Long)
- 3.13.2.2.
- BIGINT UNSIGNED (ULong)
- 3.13.2.3.
- BINARY (byte[])
- 3.13.2.4.
- BIT (Boolean)
- 3.13.2.5.
- BLOB (byte[])
- 3.13.2.6.
- BOOLEAN (Boolean)
- 3.13.2.7.
- CHAR (String)
- 3.13.2.8.
- CLOB (String)
- 3.13.2.9.
- DATE (Date)
- 3.13.2.10.
- DECIMAL (BigDecimal)
- 3.13.2.11.
- DECIMAL INTEGER (BigInteger)
- 3.13.2.12.
- DOUBLE (Double)
- 3.13.2.13.
- FLOAT (Double)
- 3.13.2.14.
- GEOGRAPHY (Geography)
- 3.13.2.15.
- GEOMETRY (Geometry)
- 3.13.2.16.
- INSTANT (Instant)
- 3.13.2.17.
- INTEGER (Integer)
- 3.13.2.18.
- INTEGER UNSIGNED (UInteger)
- 3.13.2.19.
- INTERVAL (YearToSecond)
- 3.13.2.20.
- INTERVAL DAY TO SECOND (DayToSecond)
- 3.13.2.21.
- INTERVAL YEAR TO MONTH (YearToMonth)
- 3.13.2.22.
- JSON (JSON)
- 3.13.2.23.
- JSONB (JSONB)
- 3.13.2.24.
- LOCALDATE (LocalDate)
- 3.13.2.25.
- LOCALDATETIME (LocalDateTime)
- 3.13.2.26.
- LOCALTIME (LocalTime)
- 3.13.2.27.
- LONGNVARCHAR (String)
- 3.13.2.28.
- LONGVARBINARY (byte[])
- 3.13.2.29.
- LONGVARCHAR (String)
- 3.13.2.30.
- NCHAR (String)
- 3.13.2.31.
- NCLOB (String)
- 3.13.2.32.
- NUMERIC (BigDecimal)
- 3.13.2.33.
- NVARCHAR (String)
- 3.13.2.34.
- OFFSETDATETIME (OffsetDateTime)
- 3.13.2.35.
- OFFSETTIME (OffsetTime)
- 3.13.2.36.
- OTHER (Object)
- 3.13.2.37.
- REAL (Float)
- 3.13.2.38.
- RECORD (Record)
- 3.13.2.39.
- RESULT (Result)
- 3.13.2.40.
- ROWID (RowId)
- 3.13.2.41.
- SMALLINT (Short)
- 3.13.2.42.
- SMALLINT UNSIGNED (UShort)
- 3.13.2.43.
- TIME (Time)
- 3.13.2.44.
- TIMESTAMP (Timestamp)
- 3.13.2.45.
- TIMESTAMP WITH TIME ZONE (OffsetDateTime)
- 3.13.2.46.
- TIME WITH TIME ZONE (OffsetTime)
- 3.13.2.47.
- TINYINT (Byte)
- 3.13.2.48.
- TINYINT UNSIGNED (UByte)
- 3.13.2.49.
- UUID (UUID)
- 3.13.2.50.
- VARBINARY (byte[])
- 3.13.2.51.
- VARCHAR (String)
- 3.13.2.52.
- XML (XML)
- 3.13.3.
- Extended data types
- 3.13.3.1.
- PostgreSQL CIDR type (new)
- 3.13.3.2.
- PostgreSQL CITEXT type (new)
- 3.13.3.3.
- PostgreSQL DATERANGE type (new)
- 3.13.3.4.
- PostgreSQL HSTORE type
- 3.13.3.5.
- PostgreSQL INET type (new)
- 3.13.3.6.
- PostgreSQL INT4RANGE type (new)
- 3.13.3.7.
- PostgreSQL INT8RANGE type (new)
- 3.13.3.8.
- PostgreSQL LTREE type (new)
- 3.13.3.9.
- PostgreSQL NUMRANGE type (new)
- 3.13.3.10.
- PostgreSQL TSRANGE type (new)
- 3.13.3.11.
- PostgreSQL TSTZRANGE type (new)
- 3.13.4.
- Enum data types
- 3.13.5.
- Domain data types
- 3.13.6.
- User-defined data types (UDTs)
- 3.13.7.
- Converted data types
- 3.13.7.1.
- Custom data type Converter
- 3.13.7.2.
- Custom data type Binding
previous : next |
Feedback
Do you have any feedback about this page? We'd love to hear it!