- java.lang.Object
-
- java.lang.Enum<SQLDialect>
-
- org.jooq.SQLDialect
-
- All Implemented Interfaces:
Serializable
,Comparable<SQLDialect>
public enum SQLDialect extends Enum<SQLDialect>
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#POSTGRES_9_3
#POSTGRES_9_4
#POSTGRES_9_5
#POSTGRES_10
#POSTGRES_11
#POSTGRES_12
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/2019/06/26/how-to-use-jooqs-commercial-distributions-with-spring-boot/.
- Author:
- Lukas Eder
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
SQLDialect.ThirdParty
Third party representations of the enclosingSQLDialect
.
-
Enum Constant Summary
Enum Constants Enum Constant Description CUBRID
Deprecated, for removal: This API element is subject to removal in a future version.- [#9403] - 3.13.0 - This dialect is hardly used by anyone with jOOQ or without jOOQ and will be removed in the near future.DEFAULT
The default SQL dialect.DERBY
The Apache Derby dialect family.FIREBIRD
The Firebird dialect family.H2
The H2 dialect family.HSQLDB
The Hypersonic dialect family.IGNITE
The Apache Ignite dialect family.MARIADB
The MariaDB dialect family.MYSQL
The MySQL dialect family.POSTGRES
The PostgreSQL dialect family.SQL99
Deprecated.- [#3844] - 3.6.0 -DEFAULT
will replace this pseudo-dialect.SQLITE
The SQLite dialect family.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
commercial()
Whether this dialect is supported with the jOOQ commercial license only.static @NotNull SQLDialect[]
families()
Get a list of allfamily()
values.@NotNull SQLDialect
family()
The dialect family.@NotNull String
getName()
The name of this dialect as it appears in related class names.@NotNull String
getNameLC()
The name of this dialect as it appears in related package names.@NotNull String
getNameUC()
The name of this dialect as it appears in related enum values.boolean
isFamily()
Whether this dialect is afamily()
.boolean
isVersioned()
Whether this dialect is a versioned dialect or a family with versioned dialects.boolean
precedes(SQLDialect other)
Whether this dialect precedes an other dialect from the same family.@NotNull SQLDialect
predecessor()
The predecessor dialect.@NotNull Set<SQLDialect>
predecessors()
The predecessor dialects.static @NotNull Set<SQLDialect>
predecessors(SQLDialect... dialects)
Get a set of dialects preceding a given set of dialects.boolean
supported()
Whether this dialect is supported by jOOQ as an output dialect.static @NotNull Set<SQLDialect>
supportedBy(SQLDialect dialect)
Get a set of supported dialect versions and successors given a dialect version.static @NotNull Set<SQLDialect>
supportedBy(SQLDialect... dialects)
Get a set of supported dialect versions and successors given a set of dialect versions.static @NotNull Set<SQLDialect>
supportedUntil(SQLDialect dialect)
Get a set of supported dialect versions and predecessors given a dialect version.static @NotNull Set<SQLDialect>
supportedUntil(SQLDialect... dialects)
Get a set of supported dialect versions and predecessors given a dialect version.boolean
supports(Collection<SQLDialect> other)
Deprecated, for removal: This API element is subject to removal in a future version.- [#9882] - 3.14.0 - UsesupportedBy(SQLDialect...)
insteadboolean
supports(SQLDialect other)
Check whether this dialect supports another one.@NotNull SQLDialect.ThirdParty
thirdParty()
Get access to third party representations of thisSQLDialect
.static SQLDialect
valueOf(String name)
Returns the enum constant of this type with the specified name.static SQLDialect[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
SQL99
@Deprecated public static final SQLDialect SQL99
Deprecated.- [#3844] - 3.6.0 -DEFAULT
will replace this pseudo-dialect.The standard SQL dialect family.
-
DEFAULT
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.
-
CUBRID
@Deprecated(forRemoval=true, since="3.13") public static final SQLDialect CUBRID
Deprecated, for removal: This API element is subject to removal in a future version.- [#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.
-
DERBY
public static final SQLDialect DERBY
The Apache Derby dialect family.
-
FIREBIRD
public static final SQLDialect FIREBIRD
The Firebird dialect family.This family behaves like the versioned dialect
#FIREBIRD_3_0
.
-
H2
public static final SQLDialect H2
The H2 dialect family.
-
HSQLDB
public static final SQLDialect HSQLDB
The Hypersonic dialect family.
-
IGNITE
public static final SQLDialect IGNITE
The Apache Ignite dialect family.
-
MARIADB
public static final SQLDialect MARIADB
The MariaDB dialect family.This family behaves like the versioned dialect
#MARIADB_10_5
.
-
MYSQL
public static final SQLDialect MYSQL
The MySQL dialect family.This family behaves like the versioned dialect
#MYSQL_8_0_19
.
-
POSTGRES
public static final SQLDialect POSTGRES
The PostgreSQL dialect family.This family behaves like the versioned dialect
#POSTGRES_13
.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.
-
SQLITE
public static final SQLDialect SQLITE
The SQLite dialect family.This family behaves like the versioned dialect
#SQLITE_3_30
.
-
-
Method Detail
-
values
public static SQLDialect[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (SQLDialect c : SQLDialect.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static SQLDialect valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
families
@NotNull public static final @NotNull SQLDialect[] families()
Get a list of allfamily()
values.
-
predecessors
@NotNull 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.
-
supportedUntil
@NotNull 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.
-
supportedUntil
@NotNull 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.
-
supportedBy
@NotNull 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.
-
supportedBy
@NotNull 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.
-
commercial
public final boolean commercial()
Whether this dialect is supported with the jOOQ commercial license only.
-
supported
public final boolean supported()
Whether this dialect is supported by jOOQ as an output dialect.Unsupported, non-output dialects include:
DEFAULT
: A hypothetical dialect used forQueryPart.toString()
calls of unattached query parts.SQL99
: A legacy version ofDEFAULT
.#POSTGRESPLUS
: A not yet supported dialect.
-
family
@NotNull 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();
-
isFamily
public final boolean isFamily()
Whether this dialect is afamily()
.
-
isVersioned
public final boolean isVersioned()
Whether this dialect is a versioned dialect or a family with versioned dialects.
-
predecessor
@NotNull 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.
-
predecessors
@NotNull public final @NotNull Set<SQLDialect> predecessors()
The predecessor dialects.Recursively calls
predecessor()
and finds all the preceding dialects to this one, including this one.
-
precedes
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 dialecttrue
if this dialect precedes the other dialect via any number of calls topredecessor()
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 { }
-
supports
public final boolean supports(SQLDialect other)
Check whether this dialect supports another one.This is:
false
if dialects don't belong to the same familytrue
if either dialectisFamily()
true
ifother
dialect precedes this dialect
The
other
argument dialect is typically referenced from aSupport
annotation, whereas this dialect is the user dialect.
-
supports
@Deprecated(forRemoval=true, since="3.14") public final boolean supports(Collection<SQLDialect> other)
Deprecated, for removal: This API element is subject to removal in a future version.- [#9882] - 3.14.0 - UsesupportedBy(SQLDialect...)
insteadCheck whether this dialect supports any dialect from the argument collection.
-
getName
@NotNull public final @NotNull String getName()
The name of this dialect as it appears in related class names.
-
getNameLC
@NotNull public final @NotNull String getNameLC()
The name of this dialect as it appears in related package names.
-
getNameUC
@NotNull public final @NotNull String getNameUC()
The name of this dialect as it appears in related enum values.
-
thirdParty
@NotNull public final @NotNull SQLDialect.ThirdParty thirdParty()
Get access to third party representations of thisSQLDialect
.
-
-