ORDER BY clause to the query
*/
- @Support({ CUBRID, DB2, H2, HSQLDB, MARIADB, MYSQL, ORACLE, POSTGRES, SYBASE })
+ @Support({ CUBRID, DB2, H2, HSQLDB, MARIADB, MYSQL, ORACLE11G, ORACLE12C, POSTGRES, SYBASE })
@Transition(
name = "ORDER BY",
args = "SortField+"
@@ -84,7 +85,7 @@ public interface GroupConcatOrderByStep extends GroupConcatSeparatorStep {
/**
* Add an ORDER BY clause to the query
*/
- @Support({ CUBRID, DB2, H2, HSQLDB, MARIADB, MYSQL, ORACLE, POSTGRES, SYBASE })
+ @Support({ CUBRID, DB2, H2, HSQLDB, MARIADB, MYSQL, ORACLE11G, ORACLE12C, POSTGRES, SYBASE })
@Transition(
name = "ORDER BY",
args = "SortField+"
diff --git a/jOOQ/src/main/java/org/jooq/GroupConcatSeparatorStep.java b/jOOQ/src/main/java/org/jooq/GroupConcatSeparatorStep.java
index e654206d3e..0b53f46761 100644
--- a/jOOQ/src/main/java/org/jooq/GroupConcatSeparatorStep.java
+++ b/jOOQ/src/main/java/org/jooq/GroupConcatSeparatorStep.java
@@ -41,7 +41,8 @@ import static org.jooq.SQLDialect.H2;
import static org.jooq.SQLDialect.HSQLDB;
import static org.jooq.SQLDialect.MARIADB;
import static org.jooq.SQLDialect.MYSQL;
-import static org.jooq.SQLDialect.ORACLE;
+import static org.jooq.SQLDialect.ORACLE11G;
+import static org.jooq.SQLDialect.ORACLE12C;
import static org.jooq.SQLDialect.POSTGRES;
import static org.jooq.SQLDialect.SYBASE;
@@ -61,7 +62,7 @@ public interface GroupConcatSeparatorStep extends AggregateFunctionGROUP_CONCAT function
*/
- @Support({ CUBRID, DB2, H2, HSQLDB, MARIADB, MYSQL, ORACLE, POSTGRES, SYBASE })
+ @Support({ CUBRID, DB2, H2, HSQLDB, MARIADB, MYSQL, ORACLE11G, ORACLE12C, POSTGRES, SYBASE })
@Transition(
name = "SEPARATOR",
args = "String"
diff --git a/jOOQ/src/main/java/org/jooq/OrderedAggregateFunction.java b/jOOQ/src/main/java/org/jooq/OrderedAggregateFunction.java
index c09bae29c9..f968ed847f 100644
--- a/jOOQ/src/main/java/org/jooq/OrderedAggregateFunction.java
+++ b/jOOQ/src/main/java/org/jooq/OrderedAggregateFunction.java
@@ -35,7 +35,8 @@
*/
package org.jooq;
-import static org.jooq.SQLDialect.ORACLE;
+import static org.jooq.SQLDialect.ORACLE11G;
+import static org.jooq.SQLDialect.ORACLE12C;
import java.util.Collection;
@@ -72,7 +73,7 @@ public interface OrderedAggregateFunctionWITHIN GROUP (ORDER BY ..) clause to the ordered
* aggregate function
*/
- @Support(ORACLE)
+ @Support({ ORACLE11G, ORACLE12C })
@Transition(
name = "WITHIN GROUP ORDER BY",
args = "Field+",
@@ -84,7 +85,7 @@ public interface OrderedAggregateFunctionWITHIN GROUP (ORDER BY ..) clause to the ordered
* aggregate function
*/
- @Support(ORACLE)
+ @Support({ ORACLE11G, ORACLE12C })
@Transition(
name = "WITHIN GROUP ORDER BY",
args = "SortField+",
@@ -96,7 +97,7 @@ public interface OrderedAggregateFunctionWITHIN GROUP (ORDER BY ..) clause to the ordered
* aggregate function
*/
- @Support(ORACLE)
+ @Support({ ORACLE11G, ORACLE12C })
@Transition(
name = "WITHIN GROUP ORDER BY",
args = "SortField+",
diff --git a/jOOQ/src/main/java/org/jooq/PivotForStep.java b/jOOQ/src/main/java/org/jooq/PivotForStep.java
index d0fa4e65ed..9c6fdaabad 100644
--- a/jOOQ/src/main/java/org/jooq/PivotForStep.java
+++ b/jOOQ/src/main/java/org/jooq/PivotForStep.java
@@ -35,7 +35,8 @@
*/
package org.jooq;
-import static org.jooq.SQLDialect.ORACLE;
+import static org.jooq.SQLDialect.ORACLE11G;
+import static org.jooq.SQLDialect.ORACLE12C;
import org.jooq.api.annotation.State;
import org.jooq.api.annotation.Transition;
@@ -60,7 +61,7 @@ public interface PivotForStep {
* @param field The pivoting field
* @return A DSL object to create the PIVOT expression
*/
- @Support({ ORACLE })
+ @Support({ ORACLE11G, ORACLE12C })
@Transition(
name = "FOR",
args = "Field"
diff --git a/jOOQ/src/main/java/org/jooq/PivotInStep.java b/jOOQ/src/main/java/org/jooq/PivotInStep.java
index 403cb3ec0d..f8ade8ee37 100644
--- a/jOOQ/src/main/java/org/jooq/PivotInStep.java
+++ b/jOOQ/src/main/java/org/jooq/PivotInStep.java
@@ -35,7 +35,8 @@
*/
package org.jooq;
-import static org.jooq.SQLDialect.ORACLE;
+import static org.jooq.SQLDialect.ORACLE11G;
+import static org.jooq.SQLDialect.ORACLE12C;
import java.util.Collection;
@@ -59,7 +60,7 @@ public interface PivotInStep* This has been observed to work with *
PIVOT expression
*/
- @Support({ ORACLE })
+ @Support({ ORACLE11G, ORACLE12C })
@Transition(
name = "PIVOT",
args = "Field+"
@@ -357,7 +359,7 @@ public interface TablePIVOT expression
* @see #pivot(Field...)
*/
- @Support({ ORACLE })
+ @Support({ ORACLE11G, ORACLE12C })
@Transition(
name = "PIVOT",
args = "Field+"
diff --git a/jOOQ/src/main/java/org/jooq/impl/AbstractRoutine.java b/jOOQ/src/main/java/org/jooq/impl/AbstractRoutine.java
index b29a60f8f1..b6246d667e 100644
--- a/jOOQ/src/main/java/org/jooq/impl/AbstractRoutine.java
+++ b/jOOQ/src/main/java/org/jooq/impl/AbstractRoutine.java
@@ -370,7 +370,7 @@ public abstract class AbstractRoutineextends AbstractQueryPart { // [#1801] Some databases do not support "derived column names". // They can be simulated by concatenating a dummy SELECT with no // results using UNION ALL - else if (fieldAliases != null && asList(H2, MARIADB, MYSQL, ORACLE, SQLITE).contains(dialect)) { + else if (fieldAliases != null && asList(H2, MARIADB, MYSQL, ORACLE, SQLITE).contains(dialect.family())) { simulateDerivedColumnList = true; SelectFieldList fields = new SelectFieldList(); diff --git a/jOOQ/src/main/java/org/jooq/impl/ArrayTable.java b/jOOQ/src/main/java/org/jooq/impl/ArrayTable.java index 8d9c8dbc94..355a44b0d0 100644 --- a/jOOQ/src/main/java/org/jooq/impl/ArrayTable.java +++ b/jOOQ/src/main/java/org/jooq/impl/ArrayTable.java @@ -174,7 +174,7 @@ class ArrayTable extends AbstractTable{ } private final Table table(Configuration configuration) { - switch (configuration.dialect()) { + switch (configuration.dialect().family()) { case ORACLE: { if (array.getDataType().getType().isArray()) { return simulate().as(alias); diff --git a/jOOQ/src/main/java/org/jooq/impl/CombineOperator.java b/jOOQ/src/main/java/org/jooq/impl/CombineOperator.java index 413427b432..58428fb3ce 100644 --- a/jOOQ/src/main/java/org/jooq/impl/CombineOperator.java +++ b/jOOQ/src/main/java/org/jooq/impl/CombineOperator.java @@ -76,7 +76,7 @@ enum CombineOperator { public String toSQL(SQLDialect dialect) { if (this == EXCEPT) { - if (dialect == SQLDialect.ORACLE) { + if (dialect.family() == SQLDialect.ORACLE) { return "minus"; } } diff --git a/jOOQ/src/main/java/org/jooq/impl/Cot.java b/jOOQ/src/main/java/org/jooq/impl/Cot.java index f464f9d569..6ca81e3b9f 100644 --- a/jOOQ/src/main/java/org/jooq/impl/Cot.java +++ b/jOOQ/src/main/java/org/jooq/impl/Cot.java @@ -62,7 +62,7 @@ class Cot extends AbstractFunction { @Override final Field getFunction0(Configuration configuration) { - switch (configuration.dialect()) { + switch (configuration.dialect().family()) { case INGRES: case ORACLE: return DSL.cos(argument).div(DSL.sin(argument)); diff --git a/jOOQ/src/main/java/org/jooq/impl/DSL.java b/jOOQ/src/main/java/org/jooq/impl/DSL.java index db4e263a0d..17ef5c7a83 100644 --- a/jOOQ/src/main/java/org/jooq/impl/DSL.java +++ b/jOOQ/src/main/java/org/jooq/impl/DSL.java @@ -46,6 +46,8 @@ import static org.jooq.SQLDialect.INGRES; import static org.jooq.SQLDialect.MARIADB; import static org.jooq.SQLDialect.MYSQL; import static org.jooq.SQLDialect.ORACLE; +import static org.jooq.SQLDialect.ORACLE11G; +import static org.jooq.SQLDialect.ORACLE12C; import static org.jooq.SQLDialect.POSTGRES; import static org.jooq.SQLDialect.SQLITE; import static org.jooq.SQLDialect.SQLSERVER; @@ -9992,8 +9994,8 @@ public class DSL { /** * Get the aggregated concatenation for a field. * - * This is natively supported by {@link SQLDialect#ORACLE}. It is simulated - * by the following dialects: + * This is natively supported by {@link SQLDialect#ORACLE11G} upwards. It is + * simulated by the following dialects: *
*
- {@link SQLDialect#CUBRID}: Using
*GROUP_CONCAT()- {@link SQLDialect#DB2}: Using
@@ -10006,7 +10008,7 @@ public class DSL { * * @see #groupConcat(Field) */ - @Support({ CUBRID, DB2, H2, HSQLDB, MARIADB, MYSQL, ORACLE, POSTGRES, SYBASE }) + @Support({ CUBRID, DB2, H2, HSQLDB, MARIADB, MYSQL, ORACLE11G, ORACLE12C, POSTGRES, SYBASE }) @Transition( name = "LISTAGG", args = "Field" @@ -10018,8 +10020,8 @@ public class DSL { /** * Get the aggregated concatenation for a field. *XMLAGG()- * This is natively supported by {@link SQLDialect#ORACLE}. It is simulated - * by the following dialects: + * This is natively supported by {@link SQLDialect#ORACLE11G} upwards. It is + * simulated by the following dialects: *
*
- {@link SQLDialect#CUBRID}: Using
*GROUP_CONCAT- {@link SQLDialect#DB2}: Using
@@ -10032,7 +10034,7 @@ public class DSL { * * @see #groupConcat(Field) */ - @Support({ CUBRID, DB2, H2, HSQLDB, MARIADB, MYSQL, ORACLE, POSTGRES, SYBASE }) + @Support({ CUBRID, DB2, H2, HSQLDB, MARIADB, MYSQL, ORACLE11G, ORACLE12C, POSTGRES, SYBASE }) @Transition( name = "LISTAGG", args = { diff --git a/jOOQ/src/main/java/org/jooq/impl/Decode.java b/jOOQ/src/main/java/org/jooq/impl/Decode.java index b3f70008ff..145cee0aaa 100644 --- a/jOOQ/src/main/java/org/jooq/impl/Decode.java +++ b/jOOQ/src/main/java/org/jooq/impl/Decode.java @@ -68,7 +68,7 @@ class DecodeXMLAGG()extends AbstractFunction { @SuppressWarnings("unchecked") @Override final Field getFunction0(Configuration configuration) { - switch (configuration.dialect()) { + switch (configuration.dialect().family()) { // Oracle actually has this function case ORACLE: { diff --git a/jOOQ/src/main/java/org/jooq/impl/DefaultDataType.java b/jOOQ/src/main/java/org/jooq/impl/DefaultDataType.java index c24cf41d1f..1ef4bab050 100644 --- a/jOOQ/src/main/java/org/jooq/impl/DefaultDataType.java +++ b/jOOQ/src/main/java/org/jooq/impl/DefaultDataType.java @@ -458,7 +458,7 @@ public class DefaultDataType implements DataType { return Types.STRUCT; } else if (Result.class.isAssignableFrom(type)) { - switch (dialect) { + switch (dialect.family()) { case ORACLE: case H2: return -10; // OracleTypes.CURSOR; diff --git a/jOOQ/src/main/java/org/jooq/impl/Degrees.java b/jOOQ/src/main/java/org/jooq/impl/Degrees.java index 4bd657b508..89a273b1aa 100644 --- a/jOOQ/src/main/java/org/jooq/impl/Degrees.java +++ b/jOOQ/src/main/java/org/jooq/impl/Degrees.java @@ -64,7 +64,7 @@ class Degrees extends AbstractFunction { @Override final Field getFunction0(Configuration configuration) { - switch (configuration.dialect()) { + switch (configuration.dialect().family()) { case FIREBIRD: case INGRES: case ORACLE: diff --git a/jOOQ/src/main/java/org/jooq/impl/Expression.java b/jOOQ/src/main/java/org/jooq/impl/Expression.java index 6ef1d2a9a8..4144984e2f 100644 --- a/jOOQ/src/main/java/org/jooq/impl/Expression.java +++ b/jOOQ/src/main/java/org/jooq/impl/Expression.java @@ -126,57 +126,57 @@ class Expression extends AbstractFunction { @SuppressWarnings("unchecked") @Override final Field getFunction0(Configuration configuration) { - SQLDialect dialect = configuration.dialect(); + SQLDialect family = configuration.dialect().family(); // --------------------------------------------------------------------- // XXX: Bitwise operators // --------------------------------------------------------------------- // DB2, H2 and HSQLDB know functions, instead of operators - if (BIT_AND == operator && asList(DB2, H2, HSQLDB, ORACLE).contains(dialect)) { + if (BIT_AND == operator && asList(DB2, H2, HSQLDB, ORACLE).contains(family)) { return function("bitand", getDataType(), getArguments()); } - else if (BIT_AND == operator && FIREBIRD == dialect) { + else if (BIT_AND == operator && FIREBIRD == family) { return function("bin_and", getDataType(), getArguments()); } - else if (BIT_XOR == operator && asList(DB2, H2, HSQLDB).contains(dialect)) { + else if (BIT_XOR == operator && asList(DB2, H2, HSQLDB).contains(family)) { return function("bitxor", getDataType(), getArguments()); } - else if (BIT_XOR == operator && FIREBIRD == dialect) { + else if (BIT_XOR == operator && FIREBIRD == family) { return function("bin_xor", getDataType(), getArguments()); } - else if (BIT_OR == operator && asList(DB2, H2, HSQLDB).contains(dialect)) { + else if (BIT_OR == operator && asList(DB2, H2, HSQLDB).contains(family)) { return function("bitor", getDataType(), getArguments()); } - else if (BIT_OR == operator && FIREBIRD == dialect) { + else if (BIT_OR == operator && FIREBIRD == family) { return function("bin_or", getDataType(), getArguments()); } // Oracle has to simulate or/xor - else if (BIT_OR == operator && ORACLE == dialect) { + else if (BIT_OR == operator && ORACLE == family) { return lhs.sub(bitAnd(lhsAsNumber(), rhsAsNumber())).add(rhsAsNumber()); } // ~(a & b) & (a | b) - else if (BIT_XOR == operator && asList(ORACLE, SQLITE).contains(dialect)) { + else if (BIT_XOR == operator && asList(ORACLE, SQLITE).contains(family)) { return (Field ) bitAnd( bitNot(bitAnd(lhsAsNumber(), rhsAsNumber())), bitOr(lhsAsNumber(), rhsAsNumber())); } // Many dialects don't support shifts. Use multiplication/division instead - else if (SHL == operator && asList(ASE, DB2, H2, HSQLDB, INGRES, ORACLE, SQLSERVER, SYBASE).contains(dialect.family())) { + else if (SHL == operator && asList(ASE, DB2, H2, HSQLDB, INGRES, ORACLE, SQLSERVER, SYBASE).contains(family.family())) { return lhs.mul(DSL.power(two(), rhsAsNumber())); } - else if (SHR == operator && asList(ASE, DB2, H2, HSQLDB, INGRES, ORACLE, SQLSERVER, SYBASE).contains(dialect.family())) { + else if (SHR == operator && asList(ASE, DB2, H2, HSQLDB, INGRES, ORACLE, SQLSERVER, SYBASE).contains(family.family())) { return lhs.div(DSL.power(two(), rhsAsNumber())); } // Some dialects support shifts as functions - else if (SHL == operator && FIREBIRD == dialect) { + else if (SHL == operator && FIREBIRD == family) { return function("bin_shl", getDataType(), getArguments()); } - else if (SHR == operator && FIREBIRD == dialect) { + else if (SHR == operator && FIREBIRD == family) { return function("bin_shr", getDataType(), getArguments()); } diff --git a/jOOQ/src/main/java/org/jooq/impl/FieldMapsForInsert.java b/jOOQ/src/main/java/org/jooq/impl/FieldMapsForInsert.java index 8b86749f52..b524f2cfd8 100644 --- a/jOOQ/src/main/java/org/jooq/impl/FieldMapsForInsert.java +++ b/jOOQ/src/main/java/org/jooq/impl/FieldMapsForInsert.java @@ -77,7 +77,7 @@ class FieldMapsForInsert extends AbstractQueryPart { // True SQL92 multi-record inserts aren't always supported else { - switch (context.configuration().dialect()) { + switch (context.configuration().dialect().family()) { // Some dialects don't support multi-record inserts case ASE: diff --git a/jOOQ/src/main/java/org/jooq/impl/Limit.java b/jOOQ/src/main/java/org/jooq/impl/Limit.java index 0edfde1bcd..80cfa9d389 100644 --- a/jOOQ/src/main/java/org/jooq/impl/Limit.java +++ b/jOOQ/src/main/java/org/jooq/impl/Limit.java @@ -299,7 +299,10 @@ class Limit extends AbstractQueryPart { // Oracle knows no LIMIT or TOP clause, limits are always bound // ------------------------------------------------------------ - case ORACLE: { + case ORACLE: + case ORACLE10G: + case ORACLE11G: + case ORACLE12C: { // [#1020] With the ROWNUM filtering improvement, the upper // limit is bound before the lower limit diff --git a/jOOQ/src/main/java/org/jooq/impl/MD5.java b/jOOQ/src/main/java/org/jooq/impl/MD5.java index b551f4634c..02123ee2e0 100644 --- a/jOOQ/src/main/java/org/jooq/impl/MD5.java +++ b/jOOQ/src/main/java/org/jooq/impl/MD5.java @@ -60,7 +60,7 @@ class MD5 extends AbstractFunction { @Override final Field getFunction0(Configuration configuration) { - switch (configuration.dialect()) { + switch (configuration.dialect().family()) { case ORACLE: return field("{lower}({rawtohex}({sys}.{dbms_crypto}.{hash}({utl_raw}.{cast_to_raw}({0}), 2)))", SQLDataType.VARCHAR, argument); case MARIADB: diff --git a/jOOQ/src/main/java/org/jooq/impl/MetaDataFieldProvider.java b/jOOQ/src/main/java/org/jooq/impl/MetaDataFieldProvider.java index 4d27ca9ecd..f0636b6c44 100644 --- a/jOOQ/src/main/java/org/jooq/impl/MetaDataFieldProvider.java +++ b/jOOQ/src/main/java/org/jooq/impl/MetaDataFieldProvider.java @@ -102,7 +102,7 @@ class MetaDataFieldProvider implements Serializable { String type = meta.getColumnTypeName(i); try { - dataType = DefaultDataType.getDataType(configuration.dialect(), type, precision, scale); + dataType = DefaultDataType.getDataType(configuration.dialect().family(), type, precision, scale); if (dataType.hasPrecision()) { dataType = dataType.precision(precision); diff --git a/jOOQ/src/main/java/org/jooq/impl/MetaImpl.java b/jOOQ/src/main/java/org/jooq/impl/MetaImpl.java index fb7328ba6d..bb77c58c81 100644 --- a/jOOQ/src/main/java/org/jooq/impl/MetaImpl.java +++ b/jOOQ/src/main/java/org/jooq/impl/MetaImpl.java @@ -252,7 +252,7 @@ class MetaImpl implements Meta, Serializable { try { String[] types = null; - switch (configuration.dialect()) { + switch (configuration.dialect().family()) { // [#2323] SQLite JDBC drivers have a bug. They return other // object types, too: https://bitbucket.org/xerial/sqlite-jdbc/issue/68 diff --git a/jOOQ/src/main/java/org/jooq/impl/Neg.java b/jOOQ/src/main/java/org/jooq/impl/Neg.java index 46da03c936..8a1d29c364 100644 --- a/jOOQ/src/main/java/org/jooq/impl/Neg.java +++ b/jOOQ/src/main/java/org/jooq/impl/Neg.java @@ -73,7 +73,7 @@ class Neg extends AbstractField { public final void toSQL(RenderContext context) { SQLDialect dialect = context.configuration().dialect(); - if (operator == BIT_NOT && asList(H2, HSQLDB, INGRES, ORACLE).contains(dialect)) { + if (operator == BIT_NOT && asList(H2, HSQLDB, INGRES, ORACLE).contains(dialect.family())) { context.sql("(0 -") .sql(field) .sql(" - 1)"); diff --git a/jOOQ/src/main/java/org/jooq/impl/Nvl.java b/jOOQ/src/main/java/org/jooq/impl/Nvl.java index 7867cd5076..610f3466db 100644 --- a/jOOQ/src/main/java/org/jooq/impl/Nvl.java +++ b/jOOQ/src/main/java/org/jooq/impl/Nvl.java @@ -62,7 +62,7 @@ class Nvl extends AbstractFunction { @Override final Field getFunction0(Configuration configuration) { - switch (configuration.dialect()) { + switch (configuration.dialect().family()) { case DB2: case H2: case HSQLDB: diff --git a/jOOQ/src/main/java/org/jooq/impl/Nvl2.java b/jOOQ/src/main/java/org/jooq/impl/Nvl2.java index cf1c203d95..a063e9517a 100644 --- a/jOOQ/src/main/java/org/jooq/impl/Nvl2.java +++ b/jOOQ/src/main/java/org/jooq/impl/Nvl2.java @@ -64,7 +64,7 @@ class Nvl2 extends AbstractFunction { @Override final Field getFunction0(Configuration configuration) { - switch (configuration.dialect()) { + switch (configuration.dialect().family()) { case H2: case HSQLDB: case INGRES: diff --git a/jOOQ/src/main/java/org/jooq/impl/Pi.java b/jOOQ/src/main/java/org/jooq/impl/Pi.java index 95f0074416..c813b62c41 100644 --- a/jOOQ/src/main/java/org/jooq/impl/Pi.java +++ b/jOOQ/src/main/java/org/jooq/impl/Pi.java @@ -61,7 +61,7 @@ class Pi extends AbstractFunction { @Override final Field getFunction0(Configuration configuration) { - switch (configuration.dialect()) { + switch (configuration.dialect().family()) { case DB2: case ORACLE: return DSL.asin(one()).mul(two()); diff --git a/jOOQ/src/main/java/org/jooq/impl/Pivot.java b/jOOQ/src/main/java/org/jooq/impl/Pivot.java index 22ddf23824..2a8d3335b9 100644 --- a/jOOQ/src/main/java/org/jooq/impl/Pivot.java +++ b/jOOQ/src/main/java/org/jooq/impl/Pivot.java @@ -107,7 +107,9 @@ implements switch (configuration.dialect()) { // Oracle has native support for the PIVOT clause - case ORACLE: { + case ORACLE: + case ORACLE11G: + case ORACLE12C: { return new OraclePivotTable(); } diff --git a/jOOQ/src/main/java/org/jooq/impl/Radians.java b/jOOQ/src/main/java/org/jooq/impl/Radians.java index 2e7a708c08..d7b6e90ae3 100644 --- a/jOOQ/src/main/java/org/jooq/impl/Radians.java +++ b/jOOQ/src/main/java/org/jooq/impl/Radians.java @@ -64,7 +64,7 @@ class Radians extends AbstractFunction { @Override final Field getFunction0(Configuration configuration) { - switch (configuration.dialect()) { + switch (configuration.dialect().family()) { case FIREBIRD: case INGRES: case ORACLE: diff --git a/jOOQ/src/main/java/org/jooq/impl/Rand.java b/jOOQ/src/main/java/org/jooq/impl/Rand.java index f4aec53d55..18ea0dc49d 100644 --- a/jOOQ/src/main/java/org/jooq/impl/Rand.java +++ b/jOOQ/src/main/java/org/jooq/impl/Rand.java @@ -59,7 +59,7 @@ class Rand extends AbstractFunction { @Override final Field getFunction0(Configuration configuration) { - switch (configuration.dialect()) { + switch (configuration.dialect().family()) { case DERBY: case INGRES: case POSTGRES: diff --git a/jOOQ/src/main/java/org/jooq/impl/RowCondition.java b/jOOQ/src/main/java/org/jooq/impl/RowCondition.java index 86a08eecfd..c64bff3e7e 100644 --- a/jOOQ/src/main/java/org/jooq/impl/RowCondition.java +++ b/jOOQ/src/main/java/org/jooq/impl/RowCondition.java @@ -181,7 +181,7 @@ class RowCondition extends AbstractCondition { public final void toSQL(RenderContext context) { // Some dialects do not support != comparison with rows - if (comparator == NOT_EQUALS && asList(DB2).contains(context.configuration().dialect())) { + if (comparator == NOT_EQUALS && asList(DB2).contains(context.configuration().dialect().family())) { context.keyword("not(") .sql(left) .sql(" = ") @@ -190,7 +190,7 @@ class RowCondition extends AbstractCondition { } else { // Some databases need extra parentheses around the RHS - boolean extraParentheses = asList(ORACLE).contains(context.configuration().dialect()); + boolean extraParentheses = asList(ORACLE).contains(context.configuration().dialect().family()); context.sql(left) .sql(" ") diff --git a/jOOQ/src/main/java/org/jooq/impl/RowSubqueryCondition.java b/jOOQ/src/main/java/org/jooq/impl/RowSubqueryCondition.java index d131426b50..cac0801b6b 100644 --- a/jOOQ/src/main/java/org/jooq/impl/RowSubqueryCondition.java +++ b/jOOQ/src/main/java/org/jooq/impl/RowSubqueryCondition.java @@ -101,17 +101,17 @@ class RowSubqueryCondition extends AbstractCondition { } private final QueryPartInternal delegate(Configuration configuration, RenderContext context) { - SQLDialect dialect = configuration.dialect(); + SQLDialect family = configuration.dialect().family(); // [#2395] These dialects have full native support for comparison // predicates with row value expressions and subqueries: - if (asList(H2, HSQLDB, MARIADB, MYSQL, POSTGRES).contains(dialect)) { + if (asList(H2, HSQLDB, MARIADB, MYSQL, POSTGRES).contains(family)) { return new Native(); } // [#2395] These dialects have native support for = and <> else if ( - asList(H2, HSQLDB, MARIADB, MYSQL, ORACLE, POSTGRES).contains(dialect) && + asList(H2, HSQLDB, MARIADB, MYSQL, ORACLE, POSTGRES).contains(family) && asList(EQUALS, NOT_EQUALS).contains(comparator)) { return new Native(); @@ -119,7 +119,7 @@ class RowSubqueryCondition extends AbstractCondition { // [#2395] These dialects have native support for IN and NOT IN else if ( - asList(H2, DB2, HSQLDB, MARIADB, MYSQL, ORACLE, POSTGRES).contains(dialect) && + asList(H2, DB2, HSQLDB, MARIADB, MYSQL, ORACLE, POSTGRES).contains(family) && asList(IN, NOT_IN).contains(comparator)) { return new Native(); @@ -193,7 +193,7 @@ class RowSubqueryCondition extends AbstractCondition { public final void toSQL(RenderContext context) { // Some databases need extra parentheses around the RHS - boolean extraParentheses = asList(ORACLE).contains(context.configuration().dialect()); + boolean extraParentheses = asList(ORACLE).contains(context.configuration().dialect().family()); boolean subquery = context.subquery(); context.sql(left) diff --git a/jOOQ/src/main/java/org/jooq/impl/SelectQueryImpl.java b/jOOQ/src/main/java/org/jooq/impl/SelectQueryImpl.java index 1b73de58b8..0d62e35585 100644 --- a/jOOQ/src/main/java/org/jooq/impl/SelectQueryImpl.java +++ b/jOOQ/src/main/java/org/jooq/impl/SelectQueryImpl.java @@ -187,6 +187,9 @@ class SelectQueryImpl extends AbstractSelect implements Sel // Oracle knows the ROWNUM pseudo-column. That makes things simple case ORACLE: + case ORACLE10G: + case ORACLE11G: + case ORACLE12C: toSQLReferenceLimitOracle(context); break; @@ -267,7 +270,7 @@ class SelectQueryImpl extends AbstractSelect implements Sel else if (!forUpdateOfTables.isEmpty()) { context.keyword(" of "); - switch (context.configuration().dialect()) { + switch (context.configuration().dialect().family()) { // Some dialects don't allow for an OF [table-names] clause // It can be simulated by listing the table's fields, though diff --git a/jOOQ/src/main/java/org/jooq/impl/UDTConstant.java b/jOOQ/src/main/java/org/jooq/impl/UDTConstant.java index 111145e281..2923687a86 100644 --- a/jOOQ/src/main/java/org/jooq/impl/UDTConstant.java +++ b/jOOQ/src/main/java/org/jooq/impl/UDTConstant.java @@ -60,7 +60,7 @@ class UDTConstant > extends AbstractParam { @Override public final void toSQL(RenderContext context) { - switch (context.configuration().dialect()) { + switch (context.configuration().dialect().family()) { // Oracle supports java.sql.SQLData, hence the record can be bound // to the CallableStatement directly @@ -123,7 +123,7 @@ class UDTConstant > extends AbstractParam { private String getInlineConstructor(RenderContext context) { // TODO [#884] Fix this with a local render context (using ctx.literal) - switch (context.configuration().dialect()) { + switch (context.configuration().dialect().family()) { case POSTGRES: return "ROW"; @@ -147,7 +147,7 @@ class UDTConstant > extends AbstractParam { @Override public final void bind(BindContext context) { - switch (context.configuration().dialect()) { + switch (context.configuration().dialect().family()) { // Oracle supports java.sql.SQLData, hence the record can be bound // to the CallableStatement directly diff --git a/jOOQ/src/main/java/org/jooq/impl/UpdateQueryImpl.java b/jOOQ/src/main/java/org/jooq/impl/UpdateQueryImpl.java index cc68b04a03..0cb744f753 100644 --- a/jOOQ/src/main/java/org/jooq/impl/UpdateQueryImpl.java +++ b/jOOQ/src/main/java/org/jooq/impl/UpdateQueryImpl.java @@ -463,7 +463,7 @@ class UpdateQueryImpl extends AbstractStoreQuery implements // Some dialects don't really support row value expressions on the // right hand side of a SET clause - if (multiValue != null && !asList(INGRES, ORACLE).contains(context.configuration().dialect())) { + if (multiValue != null && !asList(INGRES, ORACLE).contains(context.configuration().dialect().family())) { context.sql(multiValue); } diff --git a/jOOQ/src/main/java/org/jooq/impl/Val.java b/jOOQ/src/main/java/org/jooq/impl/Val.java index ff5ffab311..cf90067442 100644 --- a/jOOQ/src/main/java/org/jooq/impl/Val.java +++ b/jOOQ/src/main/java/org/jooq/impl/Val.java @@ -173,7 +173,7 @@ class Val extends AbstractParam { // the safe side, always cast these types in those dialects that support // them if (getDataType().isInterval()) { - switch (context.configuration().dialect()) { + switch (context.configuration().dialect().family()) { case ORACLE: case POSTGRES: return true;