This documentation is for the unreleased development version of jOOQ. Click on the above version links to get this documentation for a supported version of jOOQ.
Domain data types
Supported by ✅ Open Source Edition ✅ Express Edition ✅ Professional Edition ✅ Enterprise Edition
A DOMAIN
type is a standard SQL way of declaring a type name to be associated with a set of restrictions on existing types, typically on Built-in data types. Domain types can be created using the CREATE DOMAIN statement. The simplest type just declares the base type it enhances, without any additional clauses or constraints:
CREATE DOMAIN email AS VARCHAR(256)
To get a hold of the backing DataType<String>
for this domain type, the generated code can be used as follows:
DataType<String> emailType = Domains.EMAIL.getDataType();
Additional type safety can be achieved using embedded domains, in case of which:
DataType<EmailRecord> emailType = Domains.EMAIL.getDataType();
Feedback
Do you have any feedback about this page? We'd love to hear it!