[jOOQ/jOOQ#9840] Remove DSL.groupingId() from jOOQ Open Source Edition, as no OSS dialect supports it

This commit is contained in:
Lukas Eder 2020-02-14 10:54:56 +01:00
parent b5306ca559
commit 571dc579f6
2 changed files with 30 additions and 26 deletions

View File

@ -16708,6 +16708,28 @@ public class DSL {
/**
* Create a GROUPING(field) aggregation field to be used along with
* <code>CUBE</code>, <code>ROLLUP</code>, and <code>GROUPING SETS</code>
@ -16732,27 +16754,6 @@ public class DSL {
return function("grouping", Integer.class, field);
}
/**
* Create a GROUPING_ID(field1, field2, .., fieldn) aggregation field to be
* used along with <code>CUBE</code>, <code>ROLLUP</code>, and
* <code>GROUPING SETS</code> groupings.
* <p>
* This has been observed to work with the following databases:
* <ul>
* <li>Oracle</li>
* <li>SQL Server</li>
* </ul>
*
* @param fields The function arguments
* @return The <code>GROUPING_ID</code> aggregation field
* @see #cube(Field...)
* @see #rollup(Field...)
*/
@Support({ })
public static Field<Integer> groupingId(Field<?>... fields) {
return function("grouping_id", Integer.class, fields);
}
// ------------------------------------------------------------------------
// XXX Bitwise operations
// ------------------------------------------------------------------------

View File

@ -6843,12 +6843,15 @@ final class ParserImpl implements Parser {
}
private static final Field<?> parseFieldGroupingIdIf(ParserContext ctx) {
if (parseFunctionNameIf(ctx, "GROUPING_ID")) {
parse(ctx, '(');
List<Field<?>> fields = parseFields(ctx);
parse(ctx, ')');
if (parseFunctionNameIf(ctx, "GROUPING_ID") && ctx.requireProEdition()) {
return groupingId(fields.toArray(EMPTY_FIELD));
}
return null;