Top Description Inners Fields Constructors Methods
org.jooq

public final Enum SQLDialect

extends Enum<SQLDialect>
Class Inheritance
Imports
java.sql.DatabaseMetaData, java.util.Collection, .Collections, .EnumSet, .Set, java.util.concurrent.locks.Condition, java.util.regex.Pattern, org.jetbrains.annotations.NotNull, .Nullable

Dialects and dialect families as supported by jOOQ.

The commercial jOOQ distributions support a variety of dialects, which are grouped into dialect families. For instance, the PostgreSQL dialect family POSTGRES is specialised by its dialects

The open source jOOQ distributions only support the dialect family, which corresponds to the latest supported dialect version of the commercial distribution. A full list of mappings between dialect families and latest supported version can be seen here https://www.jooq.org/download/support-matrix.

If a dialect is documented but does not seem to be available in your jOOQ Edition, you may be using the wrong edition, e.g. because of a transitive dependency introduced by Spring Boot. See this article about how to exclude such transitive dependencies from your classpath https://blog.jooq.org/how-to-use-jooqs-commercial-distributions-with-spring-boot/.

Author
Lukas Eder

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static record
public class
SQLDialect.ThirdParty

Third party representations of the enclosing SQLDialect.

Field Summary

Modifier and TypeField and Description
private final SQLDialectCategory
private final boolean
public static final SQLDialect
CUBRID

The CUBRID dialect family.

public static final SQLDialect
DEFAULT

The default SQL dialect.

public static final SQLDialect
DERBY

The Apache Derby dialect family.

private static final SQLDialect[]
private final SQLDialect
public static final SQLDialect
FIREBIRD

The Firebird dialect family.

public static final SQLDialect
H2

The H2 dialect family.

public static final SQLDialect
HSQLDB

The Hypersonic dialect family.

public static final SQLDialect
IGNITE

The Apache Ignite dialect family.

public static final SQLDialect
MARIADB

The MariaDB dialect family.

public static final SQLDialect
MYSQL

The MySQL dialect family.

private final String
private static final Pattern
public static final SQLDialect
POSTGRES

The PostgreSQL dialect family.

private SQLDialect
private transient EnumSet<SQLDialect>
private final SQLDialect.RequiredVersion
public static final SQLDialect
SQLITE

The SQLite dialect family.

private final boolean
private final SQLDialect.ThirdParty
public static final SQLDialect
YUGABYTEDB

The YugabyteDB dialect family.

Constructor Summary

AccessConstructor and Description
private
SQLDialect(String name, boolean commercial, boolean supported)

private
SQLDialect(String name, boolean commercial, boolean supported, SQLDialectCategory category)

private
SQLDialect(String name, boolean commercial, boolean supported, SQLDialect.RequiredVersion requiredVersion)

private
SQLDialect(String name, boolean commercial, boolean supported, SQLDialect.RequiredVersion requiredVersion, SQLDialectCategory category)

private
SQLDialect(String name, boolean commercial, boolean supported, SQLDialect.RequiredVersion requiredVersion, SQLDialect family)

private
SQLDialect(String name, boolean commercial, boolean supported, SQLDialect.RequiredVersion requiredVersion, SQLDialect family, SQLDialect predecessor)

private
SQLDialect(String name, boolean commercial, boolean supported, SQLDialect.RequiredVersion requiredVersion, SQLDialectCategory category, SQLDialect family, SQLDialect predecessor)

Method Summary

Modifier and TypeMethod and Description
private static final void
public final @NotNull SQLDialectCategory
category()

The dialect category.

public final boolean
commercial()

Whether this dialect is supported with the jOOQ commercial license only.

public static final @NotNull @NotNull SQLDialect[]
families()

Get a list of all SQLDialect#family() values.

public final @NotNull SQLDialect
family()

The dialect family.

public final @NotNull String
getName()

The name of this dialect as it appears in related class names.

public final @NotNull String
getNameLC()

The name of this dialect as it appears in related package names.

public final @NotNull String
getNameUC()

The name of this dialect as it appears in related enum values.

public final boolean
isFamily()

Whether this dialect is a family().

public final boolean
isVersioned()

Whether this dialect is a versioned dialect or a family with versioned dialects.

private final int
patchVersion(String productVersion)

public final boolean
precedes(SQLDialect other)

Whether this dialect precedes an other dialect from the same family.

public final boolean
precedesStrictly(SQLDialect other)

Whether this dialect strictly precedes an other dialect from the same family.

public final @NotNull SQLDialect
predecessor()

The predecessor dialect.

public static final @NotNull Set<SQLDialect>
predecessors(SQLDialect... dialects)

Get a set of dialects preceding a given set of dialects.

public final @NotNull Set<SQLDialect>
predecessors()

The predecessor dialects.

public final boolean
supported()

Whether this dialect is supported by jOOQ as an output dialect.

public static final @NotNull Set<SQLDialect>
supportedBy(SQLDialect dialect)

Get a set of supported dialect versions and successors given a dialect version.

public static final @NotNull Set<SQLDialect>
supportedBy(SQLDialect... dialects)

Get a set of supported dialect versions and successors given a set of dialect versions.

public static final @NotNull Set<SQLDialect>
supportedUntil(SQLDialect dialect)

Get a set of supported dialect versions and predecessors given a dialect version.

public static final @NotNull Set<SQLDialect>
supportedUntil(SQLDialect... dialects)

Get a set of supported dialect versions and predecessors given a dialect version.

public final boolean
supports(SQLDialect other)

Check whether this dialect supports another one.

public final boolean
supports(Collection<SQLDialect> other)

Deprecated for removal since 3.14. - [#9882] - 3.14.0 - Use supportedBy(SQLDialect...) instead
Check whether this dialect supports any dialect from the argument collection.
public final boolean
supportsDatabaseVersion(int majorVersion, int minorVersion, String productVersion)

Check if this SQLDialect supports a JDBC DatabaseMetaData#getDatabaseMajorVersion(), DatabaseMetaData#getDatabaseMinorVersion(), patch version.

public final @NotNull SQLDialect.ThirdParty
thirdParty()

Get access to third party representations of this SQLDialect.

public static SQLDialect
public static SQLDialect[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

categoryback to summary
private final SQLDialectCategory category
commercialback to summary
private final boolean commercial
CUBRIDback to summary
public static final SQLDialect CUBRID

Deprecated

for removal since 3.13.

- [#9403] - 3.13.0 - This dialect is hardly used by anyone with jOOQ or without jOOQ and will be removed in the near future.

The CUBRID dialect family.

Annotations
@Deprecated
forRemoval:true
since:3.13
DEFAULTback to summary
public static final SQLDialect DEFAULT

The default SQL dialect.

This dialect is chosen in the absence of a more explicit dialect. It is not intended to be used with any actual database as it may combined dialect-specific things from various dialects.

DERBYback to summary
public static final SQLDialect DERBY

The Apache Derby dialect family.

FAMILIESback to summary
private static final SQLDialect[] FAMILIES
familyback to summary
private final SQLDialect family
FIREBIRDback to summary
public static final SQLDialect FIREBIRD

The Firebird dialect family.

This family behaves like the versioned dialect FIREBIRD_3_0.

H2back to summary
public static final SQLDialect H2

The H2 dialect family.

HSQLDBback to summary
public static final SQLDialect HSQLDB

The Hypersonic dialect family.

IGNITEback to summary
public static final SQLDialect IGNITE

Deprecated

for removal since 3.16.

- [#12465] - 3.16.0 - This dialect is hardly used by anyone with jOOQ or without jOOQ and will be removed in the near future. If you're actively using this dialect, please get in touch for extended support: https://github.com/jOOQ/jOOQ/issues/12465

The Apache Ignite dialect family.

Annotations
@Deprecated
forRemoval:true
since:3.16
MARIADBback to summary
public static final SQLDialect MARIADB

The MariaDB dialect family.

This family behaves like the versioned dialect MARIADB_10_5.

MYSQLback to summary
public static final SQLDialect MYSQL

The MySQL dialect family.

This family behaves like the versioned dialect MYSQL_8_0_31.

nameback to summary
private final String name

Hides java.lang.Enum.name.

P_PATCH_VERSION_MYSQLback to summary
private static final Pattern P_PATCH_VERSION_MYSQL
POSTGRESback to summary
public static final SQLDialect POSTGRES

The PostgreSQL dialect family.

This family behaves like the versioned dialect POSTGRES_15.

While this family (and its dialects) have been observed to work to some extent on Amazon RedShift as well, we strongly suggest you use the official REDSHIFT support, instead.

predecessorback to summary
private SQLDialect predecessor
predecessorsback to summary
private transient EnumSet<SQLDialect> predecessors
requiredVersionback to summary
private final SQLDialect.RequiredVersion requiredVersion
SQLITEback to summary
public static final SQLDialect SQLITE

The SQLite dialect family.

This family behaves like the versioned dialect SQLITE_3_39.

supportedback to summary
private final boolean supported
thirdPartyback to summary
private final SQLDialect.ThirdParty thirdParty
YUGABYTEDBback to summary
public static final SQLDialect YUGABYTEDB

The YugabyteDB dialect family.

Constructor Detail

SQLDialectback to summary
private SQLDialect(String name, boolean commercial, boolean supported)
SQLDialectback to summary
private SQLDialect(String name, boolean commercial, boolean supported, SQLDialectCategory category)
SQLDialectback to summary
private SQLDialect(String name, boolean commercial, boolean supported, SQLDialect.RequiredVersion requiredVersion)
SQLDialectback to summary
private SQLDialect(String name, boolean commercial, boolean supported, SQLDialect.RequiredVersion requiredVersion, SQLDialectCategory category)
SQLDialectback to summary
private SQLDialect(String name, boolean commercial, boolean supported, SQLDialect.RequiredVersion requiredVersion, SQLDialect family)
SQLDialectback to summary
private SQLDialect(String name, boolean commercial, boolean supported, SQLDialect.RequiredVersion requiredVersion, SQLDialect family, SQLDialect predecessor)
SQLDialectback to summary
private SQLDialect(String name, boolean commercial, boolean supported, SQLDialect.RequiredVersion requiredVersion, SQLDialectCategory category, SQLDialect family, SQLDialect predecessor)

Method Detail

addSupportedByback to summary
private static final void addSupportedBy(SQLDialect dialect, EnumSet<SQLDialect> supported)
categoryback to summary
public final @NotNull SQLDialectCategory category()

The dialect category.

Annotations
@NotNull
commercialback to summary
public final boolean commercial()

Whether this dialect is supported with the jOOQ commercial license only.

familiesback to summary
public static final @NotNull @NotNull SQLDialect[] families()

Get a list of all SQLDialect#family() values.

Annotations
@NotNull
familyback to summary
public final @NotNull SQLDialect family()

The dialect family.

This returns the dialect itself, if it has no "parent family". E.g.


SQLSERVER == SQLSERVER2012.family();
SQLSERVER == SQLSERVER2008.family();
SQLSERVER == SQLSERVER.family();
Annotations
@NotNull
getNameback to summary
public final @NotNull String getName()

The name of this dialect as it appears in related class names.

Annotations
@NotNull
getNameLCback to summary
public final @NotNull String getNameLC()

The name of this dialect as it appears in related package names.

Annotations
@NotNull
getNameUCback to summary
public final @NotNull String getNameUC()

The name of this dialect as it appears in related enum values.

Annotations
@NotNull
isFamilyback to summary
public final boolean isFamily()

Whether this dialect is a family().

isVersionedback to summary
public final boolean isVersioned()

Whether this dialect is a versioned dialect or a family with versioned dialects.

patchVersionback to summary
private final int patchVersion(String productVersion)
precedesback to summary
public final boolean precedes(SQLDialect other)

Whether this dialect precedes an other dialect from the same family.

This returns:

  • true if this dialect is the same as the other dialect
  • true if this dialect precedes the other dialect via any number of calls to predecessor()
The above also implies that:
  • false if the two dialects do not belong to the same family

This is useful to see if some feature is supported by "at least" a given dialect version. Example:


// Do this block only if the chosen dialect supports PostgreSQL 9.4+ features
if (POSTGRES_9_4.precedes(dialect)) {
}

// Do this block only if the chosen dialect supports PostgreSQL 9.3+ features
else if (POSTGRES_9_3.precedes(dialect)) {
}

// Fall back to pre-PostgreSQL 9.3 behaviour
else {
}
precedesStrictlyback to summary
public final boolean precedesStrictly(SQLDialect other)

Whether this dialect strictly precedes an other dialect from the same family.

This returns:

  • false if this dialect is the same as the other dialect
  • true if this dialect precedes the other dialect via any number of calls to predecessor()
The above also implies that:
  • false if the two dialects do not belong to the same family

This is useful to see if some feature is supported by "at least" a given dialect version. Example:


// Do this block only if the chosen dialect was before PostgreSQL 9.3-
if (dialect.precedesStrictly(POSTGRES)) {
}

// Do this block only if the chosen dialect was before PostgreSQL 9.4-
else if (dialect.precedesStrictly(POSTGRES)) {
}

// Fall back to post-PostgreSQL 9.4+ behaviour
else {
}

predecessorback to summary
public final @NotNull SQLDialect predecessor()

The predecessor dialect.

If this is a dialect version (e.g. POSTGRES_9_4) within a family (e.g. POSTGRES), then the predecessor will point to the historically previous dialect version (e.g. POSTGRES_9_3) within the same family, or to the dialect itself if there was no predecessor explicitly supported by jOOQ.

Annotations
@NotNull
predecessorsback to summary
public static final @NotNull Set<SQLDialect> predecessors(SQLDialect... dialects)

Get a set of dialects preceding a given set of dialects.

The resulting set of dialects contain all the families and dialect versions that precede the argument dialects, including the argument dialects.

Annotations
@NotNull
predecessorsback to summary
public final @NotNull Set<SQLDialect> predecessors()

The predecessor dialects.

Recursively calls predecessor() and finds all the preceding dialects to this one, including this one.

Annotations
@NotNull
supportedback to summary
public final boolean supported()

Whether this dialect is supported by jOOQ as an output dialect.

Unsupported, non-output dialects include:

supportedByback to summary
public static final @NotNull Set<SQLDialect> supportedBy(SQLDialect dialect)

Get a set of supported dialect versions and successors given a dialect version.

The resulting set of dialects contain all the families and dialect versions that support the argument dialect, i.e. that succeed it, including the argument dialect.

Annotations
@NotNull
supportedByback to summary
public static final @NotNull Set<SQLDialect> supportedBy(SQLDialect... dialects)

Get a set of supported dialect versions and successors given a set of dialect versions.

The resulting set of dialects contain all the families and dialect versions that support the argument dialects, i.e. that succeed them, including the argument dialects.

Annotations
@NotNull
supportedUntilback to summary
public static final @NotNull Set<SQLDialect> supportedUntil(SQLDialect dialect)

Get a set of supported dialect versions and predecessors given a dialect version.

The resulting set of dialects contain all the families and dialect versions that precede the argument dialect, including the argument dialect.

Annotations
@NotNull
supportedUntilback to summary
public static final @NotNull Set<SQLDialect> supportedUntil(SQLDialect... dialects)

Get a set of supported dialect versions and predecessors given a dialect version.

The resulting set of dialects contain all the families and dialect versions that precede the argument dialect, including the argument dialects.

Annotations
@NotNull
supportsback to summary
public final boolean supports(SQLDialect other)

Check whether this dialect supports another one.

This is:

  • false if dialects don't belong to the same family
  • true if either dialect isFamily()
  • true if other dialect precedes this dialect

The other argument dialect is typically referenced from a Support annotation, whereas this dialect is the user dialect.

supportsback to summary
public final boolean supports(Collection<SQLDialect> other)

Deprecated

for removal since 3.14.

- [#9882] - 3.14.0 - Use supportedBy(SQLDialect...) instead

Check whether this dialect supports any dialect from the argument collection.

Annotations
@Deprecated
forRemoval:true
since:3.14
supportsDatabaseVersionback to summary
public final boolean supportsDatabaseVersion(int majorVersion, int minorVersion, String productVersion)

Check if this SQLDialect supports a JDBC DatabaseMetaData#getDatabaseMajorVersion(), DatabaseMetaData#getDatabaseMinorVersion(), patch version.

thirdPartyback to summary
public final @NotNull SQLDialect.ThirdParty thirdParty()

Get access to third party representations of this SQLDialect.

Annotations
@NotNull
valueOfback to summary
public static SQLDialect valueOf(String name)
valuesback to summary
public static SQLDialect[] values()
org.jooq back to summary

pack-priv final Record SQLDialect.RequiredVersion

extends Record
Class Inheritance
Record Components
major:Integer 
minor:Integer 
patch:Integer 

Field Summary

Modifier and TypeField and Description
private final Integer
major

Record Component accessed by major().

private final Integer
minor

Record Component accessed by minor().

private final Integer
patch

Record Component accessed by patch().

Constructor Summary

AccessConstructor and Description
pack-priv
RequiredVersion(Integer major, Integer minor, Integer patch)

Method Summary

Modifier and TypeMethod and Description
public final boolean
equals(Object
the reference object with which to compare.
o
)

Implements abstract java.lang.Record.equals.

Indicates whether some other object is "equal to" this one.
public final int
hashCode()

Implements abstract java.lang.Record.hashCode.

Returns a hash code value for the record.
public Integer
major()

Record Component getter of major.

public Integer
minor()

Record Component getter of minor.

public Integer
patch()

Record Component getter of patch.

public final String
toString()

Implements abstract java.lang.Record.toString.

Returns a string representation of the record.

Field Detail

majorback to summary
private final Integer major

Record Component accessed by major().

minorback to summary
private final Integer minor

Record Component accessed by minor().

patchback to summary
private final Integer patch

Record Component accessed by patch().

Constructor Detail

RequiredVersionback to summary
pack-priv RequiredVersion(Integer major, Integer minor, Integer patch)

Method Detail

equalsback to summary
public final boolean equals(Object o)

Implements abstract java.lang.Record.equals.

Doc from java.lang.Record.equals.

Indicates whether some other object is "equal to" this one. In addition to the general contract of Object.equals, record classes must further obey the invariant that when a record instance is "copied" by passing the result of the record component accessor methods to the canonical constructor, as follows:

    R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
Parameters
o:Object

the reference object with which to compare.

Returns:boolean

true if this record is equal to the argument; false otherwise.

hashCodeback to summary
public final int hashCode()

Implements abstract java.lang.Record.hashCode.

Doc from java.lang.Record.hashCode.

Returns a hash code value for the record. Obeys the general contract of Object.hashCode. For records, hashing behavior is constrained by the refined contract of Record.equals, so that any two records created from the same components must have the same hash code.

Returns:int

a hash code value for this record.

majorback to summary
public Integer major()

Record Component getter of major.

minorback to summary
public Integer minor()

Record Component getter of minor.

patchback to summary
public Integer patch()

Record Component getter of patch.

toStringback to summary
public final String toString()

Implements abstract java.lang.Record.toString.

Doc from java.lang.Record.toString.

Returns a string representation of the record. In accordance with the general contract of Object#toString(), the toString method returns a string that "textually represents" this record. The result should be a concise but informative representation that is easy for a person to read.

In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves.

Returns:String

a string representation of the object.

org.jooq back to summary

public final Class SQLDialect.ThirdParty

extends Object
Class Inheritance

Third party representations of the enclosing SQLDialect.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public final @NotNull String

Returns:

The appropriate JDBC driver class or "java.sql.Driver" if no driver class could be derived from the URL. Never null.
driver
()

"Guess" the JDBC driver from a SQLDialect.

public final @Nullable String
hibernateDialect()

The Hibernate dialect name or null, if the dialect is not supported by Hibernate.

public final @Nullable String
springDbName()

The Spring DB name or null, if the db name is not supported by Spring.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ThirdPartyback to summary
public ThirdParty()

Method Detail

driverback to summary
public final @NotNull String driver()

"Guess" the JDBC driver from a SQLDialect.

Returns:@NotNull String

The appropriate JDBC driver class or "java.sql.Driver" if no driver class could be derived from the URL. Never null.

Annotations
@NotNull
hibernateDialectback to summary
public final @Nullable String hibernateDialect()

The Hibernate dialect name or null, if the dialect is not supported by Hibernate.

Annotations
@Nullable
See Also
http://docs.jboss.org/hibernate/orm/5.0/javadocs/org/hibernate/ dialect/package-summary.html
springDbNameback to summary
public final @Nullable String springDbName()

The Spring DB name or null, if the db name is not supported by Spring.

The name returned by this method corresponds to the DB id as referenced in org/springframework/jdbc/support/sql-error-codes.xml

Annotations
@Nullable