public enum SQLDialect extends Enum<SQLDialect>
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.
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/.
Modifier and Type | Class and Description |
---|---|
class |
SQLDialect.ThirdParty
Third party representations of the enclosing
SQLDialect . |
Enum Constant and Description |
---|
CUBRID
Deprecated.
- [#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.
|
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.
|
Modifier and Type | Method and Description |
---|---|
boolean |
commercial()
Whether this dialect is supported with the jOOQ commercial license only.
|
static @NotNull SQLDialect[] |
families()
Get a list of all
family() 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 a
family() . |
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... dialects)
Get a set of supported dialect versions and successors given a set of
dialect versions.
|
static @NotNull Set<SQLDialect> |
supportedBy(SQLDialect dialect)
Get a set of supported dialect versions and successors given a dialect
version.
|
static @NotNull Set<SQLDialect> |
supportedUntil(SQLDialect... dialects)
Get a set of supported dialect versions and predecessors given a dialect
version.
|
static @NotNull Set<SQLDialect> |
supportedUntil(SQLDialect dialect)
Get a set of supported dialect versions and predecessors given a dialect
version.
|
boolean |
supports(Collection<SQLDialect> other)
Deprecated.
- [#9882] - 3.14.0 - Use
supportedBy(SQLDialect...) instead |
boolean |
supports(SQLDialect other)
Check whether this dialect supports another one.
|
@NotNull SQLDialect.ThirdParty |
thirdParty()
Get access to third party representations of this
SQLDialect . |
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.
|
@Deprecated public static final SQLDialect SQL99
DEFAULT
will replace this
pseudo-dialect.public static final SQLDialect DEFAULT
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.
@Deprecated public static final SQLDialect CUBRID
public static final SQLDialect DERBY
public static final SQLDialect FIREBIRD
This family behaves like the versioned dialect #FIREBIRD_3_0
.
public static final SQLDialect H2
public static final SQLDialect HSQLDB
public static final SQLDialect MARIADB
This family behaves like the versioned dialect #MARIADB_10_5
.
public static final SQLDialect MYSQL
This family behaves like the versioned dialect #MYSQL_8_0_19
.
public static final SQLDialect POSTGRES
This family behaves like the versioned dialect #POSTGRES_11
.
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.
public static final SQLDialect SQLITE
This family behaves like the versioned dialect #SQLITE_3_30
.
public static SQLDialect[] values()
for (SQLDialect c : SQLDialect.values()) System.out.println(c);
public static SQLDialect valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null@NotNull public static final @NotNull SQLDialect[] families()
family()
values.@NotNull public static final @NotNull Set<SQLDialect> predecessors(SQLDialect... dialects)
The resulting set of dialects contain all the families and dialect versions that precede the argument dialects.
@NotNull public static final @NotNull Set<SQLDialect> supportedUntil(SQLDialect dialect)
The resulting set of dialects contain all the families and dialect versions that precede the argument dialect.
@NotNull public static final @NotNull Set<SQLDialect> supportedUntil(SQLDialect... dialects)
The resulting set of dialects contain all the families and dialect versions that precede the argument dialect.
@NotNull public static final @NotNull Set<SQLDialect> supportedBy(SQLDialect dialect)
The resulting set of dialects contain all the families and dialect versions that support the argument dialect, i.e. that succeed it.
@NotNull public static final @NotNull Set<SQLDialect> supportedBy(SQLDialect... dialects)
The resulting set of dialects contain all the families and dialect versions that support the argument dialects, i.e. that succeed them.
public final boolean commercial()
public final boolean supported()
Unsupported, non-output dialects include:
DEFAULT
: A hypothetical dialect used for
QueryPart.toString()
calls of unattached query parts.SQL99
: A legacy version of DEFAULT
.#POSTGRESPLUS
: A not yet supported dialect.@NotNull public final @NotNull SQLDialect family()
This returns the dialect itself, if it has no "parent family". E.g.
SQLSERVER == SQLSERVER2012.family();
SQLSERVER == SQLSERVER2008.family();
SQLSERVER == SQLSERVER.family();
public final boolean isFamily()
family()
.@NotNull public final @NotNull SQLDialect predecessor()
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.
@NotNull public final @NotNull Set<SQLDialect> predecessors()
Recursively calls predecessor()
and finds all the preceding
dialects to this one, including this one.
public final boolean precedes(SQLDialect other)
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 to predecessor()
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 {
}
public final boolean supports(SQLDialect other)
This is:
false
if dialects don't belong to the same familytrue
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.
@Deprecated public final boolean supports(Collection<SQLDialect> other)
supportedBy(SQLDialect...)
instead@NotNull public final @NotNull String getName()
@NotNull public final @NotNull String getNameLC()
@NotNull public final @NotNull String getNameUC()
@NotNull public final @NotNull SQLDialect.ThirdParty thirdParty()
SQLDialect
.Copyright © 2020. All rights reserved.