[jOOQ/jOOQ#9930] Extracted AbstractAggregateFunction
- Extracted Mode - Removed Term.MODE
This commit is contained in:
parent
85d95c62df
commit
21fa22a3c9
@ -39,9 +39,11 @@ package org.jooq.impl;
|
||||
|
||||
// ...
|
||||
import static org.jooq.SQLDialect.H2;
|
||||
// ...
|
||||
import static org.jooq.SQLDialect.POSTGRES;
|
||||
import static org.jooq.impl.DSL.mode;
|
||||
import static org.jooq.impl.Names.N_MODE;
|
||||
import static org.jooq.impl.Names.N_STATS_MODE;
|
||||
|
||||
import java.util.Set;
|
||||
|
||||
@ -68,6 +70,10 @@ final class Mode<T> extends DefaultAggregateFunction<T> {
|
||||
public void accept(Context<?> ctx) {
|
||||
if (EMULATE_AS_ORDERED_SET_AGG.contains(ctx.dialect()))
|
||||
ctx.visit(mode().withinGroupOrderBy(arguments.get(0)));
|
||||
|
||||
|
||||
|
||||
|
||||
else
|
||||
super.accept(ctx);
|
||||
}
|
||||
|
||||
@ -123,6 +123,7 @@ final class Names {
|
||||
static final Name N_SINH = DSL.unquotedName("sinh");
|
||||
static final Name N_SPACE = DSL.unquotedName("space");
|
||||
static final Name N_SQRT = DSL.unquotedName("sqrt");
|
||||
static final Name N_STATS_MODE = DSL.unquotedName("stats_mode");
|
||||
static final Name N_STRING_AGG = DSL.unquotedName("string_agg");
|
||||
static final Name N_SUBSTRING = DSL.unquotedName("substring");
|
||||
static final Name N_SYSTEM_TIME = DSL.unquotedName("system_time");
|
||||
|
||||
@ -120,19 +120,6 @@ enum Term {
|
||||
return "char_length";
|
||||
}
|
||||
},
|
||||
MODE {
|
||||
@Override
|
||||
public String translate(SQLDialect dialect) {
|
||||
switch (dialect.family()) {
|
||||
|
||||
|
||||
|
||||
|
||||
default:
|
||||
return "mode";
|
||||
}
|
||||
}
|
||||
},
|
||||
OCTET_LENGTH {
|
||||
@Override
|
||||
public String translate(SQLDialect dialect) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user