diff --git a/jOOQ/src/main/java/org/jooq/impl/AbstractAggregateFunction.java b/jOOQ/src/main/java/org/jooq/impl/AbstractAggregateFunction.java index 9b0e44b4b5..388253eaa8 100644 --- a/jOOQ/src/main/java/org/jooq/impl/AbstractAggregateFunction.java +++ b/jOOQ/src/main/java/org/jooq/impl/AbstractAggregateFunction.java @@ -142,6 +142,14 @@ implements } AbstractAggregateFunction(boolean distinct, Name name, DataType type, Field... arguments) { + this(distinct, name, type, Arrays.asList(arguments)); + } + + AbstractAggregateFunction(boolean distinct, String name, DataType type, Collection> arguments) { + this(distinct, DSL.unquotedName(name), type, arguments); + } + + AbstractAggregateFunction(boolean distinct, Name name, DataType type, Collection> arguments) { super(name, type); this.distinct = distinct; diff --git a/jOOQ/src/main/java/org/jooq/impl/CumeDistAgg.java b/jOOQ/src/main/java/org/jooq/impl/CumeDistAgg.java new file mode 100644 index 0000000000..c831d4239f --- /dev/null +++ b/jOOQ/src/main/java/org/jooq/impl/CumeDistAgg.java @@ -0,0 +1,157 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Other licenses: + * ----------------------------------------------------------------------------- + * Commercial licenses for this work are available. These replace the above + * ASL 2.0 and offer limited warranties, support, maintenance, and commercial + * database integrations. + * + * For more information, please visit: https://www.jooq.org/legal/licensing + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + */ +package org.jooq.impl; + +import static org.jooq.impl.DSL.*; +import static org.jooq.impl.Internal.*; +import static org.jooq.impl.Keywords.*; +import static org.jooq.impl.Names.*; +import static org.jooq.impl.SQLDataType.*; +import static org.jooq.impl.Tools.*; +import static org.jooq.impl.Tools.BooleanDataKey.*; +import static org.jooq.impl.Tools.ExtendedDataKey.*; +import static org.jooq.impl.Tools.SimpleDataKey.*; +import static org.jooq.SQLDialect.*; + +import org.jooq.*; +import org.jooq.Function1; +import org.jooq.Record; +import org.jooq.conf.ParamType; +import org.jooq.tools.StringUtils; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashSet; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Set; + +import java.math.BigDecimal; + + +/** + * The CUME DIST statement. + */ +@SuppressWarnings({ "rawtypes", "unused" }) +final class CumeDistAgg +extends + AbstractAggregateFunction +implements + QOM.CumeDistAgg +{ + + CumeDistAgg( + Collection> fields + ) { + super( + false, + N_CUME_DIST, + NUMERIC, + fields + ); + } + + // ------------------------------------------------------------------------- + // XXX: QueryPart API + // ------------------------------------------------------------------------- + + + + @Override + public final void accept(Context ctx) { + super.accept(ctx); + } + + + + // ------------------------------------------------------------------------- + // XXX: Query Object Model + // ------------------------------------------------------------------------- + + @Override + public final QOM.UnmodifiableList> $fields() { + return QOM.unmodifiable(getArguments()); + } + + @Override + public final QOM.CumeDistAgg $fields(Collection> newValue) { + return $constructor().apply(newValue); + } + + public final Function1>, ? extends QOM.CumeDistAgg> $constructor() { + return (a1) -> new CumeDistAgg((Collection>) a1); + } + + + + + + + + + + + + + + + + + + + + + + + + // ------------------------------------------------------------------------- + // XXX: The Object API + // ------------------------------------------------------------------------- + + @Override + public boolean equals(Object that) { + if (that instanceof QOM.CumeDistAgg o) { + return + StringUtils.equals($fields(), o.$fields()) + ; + } + else + return super.equals(that); + } +} diff --git a/jOOQ/src/main/java/org/jooq/impl/DSL.java b/jOOQ/src/main/java/org/jooq/impl/DSL.java index a41a0d58d0..0ee3de3473 100644 --- a/jOOQ/src/main/java/org/jooq/impl/DSL.java +++ b/jOOQ/src/main/java/org/jooq/impl/DSL.java @@ -24915,6 +24915,94 @@ public class DSL { return new Product(field, true); } + /** + * The RANK function. + *

+ * The RANK hypothetical set aggregate function. + */ + @NotNull + @Support({ H2, POSTGRES, YUGABYTEDB }) + public static OrderedAggregateFunction rank(Field... fields) { + return new RankAgg(Arrays.asList(fields)); + } + + /** + * The RANK function. + *

+ * The RANK hypothetical set aggregate function. + */ + @NotNull + @Support({ H2, POSTGRES, YUGABYTEDB }) + public static OrderedAggregateFunction rank(Collection> fields) { + return new RankAgg(new QueryPartList<>(fields)); + } + + /** + * The DENSE_RANK function. + *

+ * The DENSE_RANK hypothetical set aggregate function. + */ + @NotNull + @Support({ H2, POSTGRES, YUGABYTEDB }) + public static OrderedAggregateFunction denseRank(Field... fields) { + return new DenseRankAgg(Arrays.asList(fields)); + } + + /** + * The DENSE_RANK function. + *

+ * The DENSE_RANK hypothetical set aggregate function. + */ + @NotNull + @Support({ H2, POSTGRES, YUGABYTEDB }) + public static OrderedAggregateFunction denseRank(Collection> fields) { + return new DenseRankAgg(new QueryPartList<>(fields)); + } + + /** + * The PERCENT_RANK function. + *

+ * The PERCENT_RANK hypothetical set aggregate function. + */ + @NotNull + @Support({ H2, POSTGRES, YUGABYTEDB }) + public static OrderedAggregateFunction percentRank(Field... fields) { + return new PercentRankAgg(Arrays.asList(fields)); + } + + /** + * The PERCENT_RANK function. + *

+ * The PERCENT_RANK hypothetical set aggregate function. + */ + @NotNull + @Support({ H2, POSTGRES, YUGABYTEDB }) + public static OrderedAggregateFunction percentRank(Collection> fields) { + return new PercentRankAgg(new QueryPartList<>(fields)); + } + + /** + * The CUME_DIST function. + *

+ * The CUME_DIST hypothetical set aggregate function. + */ + @NotNull + @Support({ H2, POSTGRES, YUGABYTEDB }) + public static OrderedAggregateFunction cumeDist(Field... fields) { + return new CumeDistAgg(Arrays.asList(fields)); + } + + /** + * The CUME_DIST function. + *

+ * The CUME_DIST hypothetical set aggregate function. + */ + @NotNull + @Support({ H2, POSTGRES, YUGABYTEDB }) + public static OrderedAggregateFunction cumeDist(Collection> fields) { + return new CumeDistAgg(new QueryPartList<>(fields)); + } + /** * The PERCENTILE_CONT function. *

@@ -32298,86 +32386,6 @@ public class DSL { return new ModeDeferred(); } - /** - * The rank(expr) within group (order by [order clause]) - * ordered-set aggregate function. - */ - @NotNull - @Support({ H2, POSTGRES, YUGABYTEDB }) - public static OrderedAggregateFunction rank(Field... fields) { - return new DefaultAggregateFunction<>(N_RANK, SQLDataType.INTEGER, fields); - } - - /** - * The rank(expr) within group (order by [order clause]) - * ordered-set aggregate function. - */ - @NotNull - @Support({ H2, POSTGRES, YUGABYTEDB }) - public static OrderedAggregateFunction rank(Collection> fields) { - return new DefaultAggregateFunction<>(N_RANK, SQLDataType.INTEGER, fields.toArray(EMPTY_FIELD)); - } - - /** - * The dense_rank(expr) within group (order by [order clause]) - * ordered-set aggregate function. - */ - @NotNull - @Support({ H2, POSTGRES, YUGABYTEDB }) - public static OrderedAggregateFunction denseRank(Field... fields) { - return new DefaultAggregateFunction<>(N_DENSE_RANK, SQLDataType.INTEGER, fields); - } - - /** - * The dense_rank(expr) within group (order by [order clause]) - * ordered-set aggregate function. - */ - @NotNull - @Support({ H2, POSTGRES, YUGABYTEDB }) - public static OrderedAggregateFunction denseRank(Collection> fields) { - return new DefaultAggregateFunction<>(N_DENSE_RANK, SQLDataType.INTEGER, fields.toArray(EMPTY_FIELD)); - } - - /** - * The percent_rank(expr) within group (order by [order clause]) - * ordered-set aggregate function. - */ - @NotNull - @Support({ H2, POSTGRES, YUGABYTEDB }) - public static OrderedAggregateFunction percentRank(Field... fields) { - return new DefaultAggregateFunction<>(N_PERCENT_RANK, SQLDataType.INTEGER, fields); - } - - /** - * The percent_rank(expr) within group (order by [order clause]) - * ordered-set aggregate function. - */ - @NotNull - @Support({ H2, POSTGRES, YUGABYTEDB }) - public static OrderedAggregateFunction percentRank(Collection> fields) { - return new DefaultAggregateFunction<>(N_PERCENT_RANK, SQLDataType.INTEGER, fields.toArray(EMPTY_FIELD)); - } - - /** - * The cume_dist(expr) within group (order by [order clause]) - * ordered-set aggregate function. - */ - @NotNull - @Support({ H2, POSTGRES, YUGABYTEDB }) - public static OrderedAggregateFunction cumeDist(Field... fields) { - return new DefaultAggregateFunction<>(N_CUME_DIST, SQLDataType.NUMERIC, fields); - } - - /** - * The cume_dist(expr) within group (order by [order clause]) - * ordered-set aggregate function. - */ - @NotNull - @Support({ H2, POSTGRES, YUGABYTEDB }) - public static OrderedAggregateFunction cumeDist(Collection> fields) { - return new DefaultAggregateFunction<>(N_CUME_DIST, SQLDataType.NUMERIC, fields.toArray(EMPTY_FIELD)); - } - // ------------------------------------------------------------------------- // XXX Window clauses // ------------------------------------------------------------------------- diff --git a/jOOQ/src/main/java/org/jooq/impl/DenseRankAgg.java b/jOOQ/src/main/java/org/jooq/impl/DenseRankAgg.java new file mode 100644 index 0000000000..c47eeb7d13 --- /dev/null +++ b/jOOQ/src/main/java/org/jooq/impl/DenseRankAgg.java @@ -0,0 +1,156 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Other licenses: + * ----------------------------------------------------------------------------- + * Commercial licenses for this work are available. These replace the above + * ASL 2.0 and offer limited warranties, support, maintenance, and commercial + * database integrations. + * + * For more information, please visit: https://www.jooq.org/legal/licensing + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + */ +package org.jooq.impl; + +import static org.jooq.impl.DSL.*; +import static org.jooq.impl.Internal.*; +import static org.jooq.impl.Keywords.*; +import static org.jooq.impl.Names.*; +import static org.jooq.impl.SQLDataType.*; +import static org.jooq.impl.Tools.*; +import static org.jooq.impl.Tools.BooleanDataKey.*; +import static org.jooq.impl.Tools.ExtendedDataKey.*; +import static org.jooq.impl.Tools.SimpleDataKey.*; +import static org.jooq.SQLDialect.*; + +import org.jooq.*; +import org.jooq.Function1; +import org.jooq.Record; +import org.jooq.conf.ParamType; +import org.jooq.tools.StringUtils; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashSet; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Set; + + + +/** + * The DENSE RANK statement. + */ +@SuppressWarnings({ "rawtypes", "unused" }) +final class DenseRankAgg +extends + AbstractAggregateFunction +implements + QOM.DenseRankAgg +{ + + DenseRankAgg( + Collection> fields + ) { + super( + false, + N_DENSE_RANK, + INTEGER, + fields + ); + } + + // ------------------------------------------------------------------------- + // XXX: QueryPart API + // ------------------------------------------------------------------------- + + + + @Override + public final void accept(Context ctx) { + super.accept(ctx); + } + + + + // ------------------------------------------------------------------------- + // XXX: Query Object Model + // ------------------------------------------------------------------------- + + @Override + public final QOM.UnmodifiableList> $fields() { + return QOM.unmodifiable(getArguments()); + } + + @Override + public final QOM.DenseRankAgg $fields(Collection> newValue) { + return $constructor().apply(newValue); + } + + public final Function1>, ? extends QOM.DenseRankAgg> $constructor() { + return (a1) -> new DenseRankAgg((Collection>) a1); + } + + + + + + + + + + + + + + + + + + + + + + + + // ------------------------------------------------------------------------- + // XXX: The Object API + // ------------------------------------------------------------------------- + + @Override + public boolean equals(Object that) { + if (that instanceof QOM.DenseRankAgg o) { + return + StringUtils.equals($fields(), o.$fields()) + ; + } + else + return super.equals(that); + } +} diff --git a/jOOQ/src/main/java/org/jooq/impl/Names.java b/jOOQ/src/main/java/org/jooq/impl/Names.java index 642f6f2fd0..7ee2cdf7af 100644 --- a/jOOQ/src/main/java/org/jooq/impl/Names.java +++ b/jOOQ/src/main/java/org/jooq/impl/Names.java @@ -98,7 +98,6 @@ final class Names { static final Name N_covarPop = systemName("covarPop"); static final Name N_covarSamp = systemName("covarSamp"); static final Name N_CUBE = systemName("cube"); - static final Name N_CUME_DIST = systemName("cume_dist"); static final Name N_CURRENT_BIGDATETIME = systemName("current_bigdatetime"); static final Name N_CURRENT_DATE = systemName("current_date"); static final Name N_CURRENT_TIME = systemName("current_time"); @@ -118,7 +117,6 @@ final class Names { static final Name N_DECODE_ORACLE = systemName("decode_oracle"); static final Name N_DEFAULT = systemName("default"); static final Name N_DELETED = systemName("deleted"); - static final Name N_DENSE_RANK = systemName("dense_rank"); static final Name N_DIV = systemName("div"); static final Name N_DUAL = systemName("dual"); static final Name N_ELEMENT_AT = systemName("element_at"); @@ -234,13 +232,11 @@ final class Names { static final Name N_ORDINAL = systemName("ordinal"); static final Name N_OREPLACE = systemName("oreplace"); static final Name N_PARSE_JSON = systemName("parse_json"); - static final Name N_PERCENT_RANK = systemName("percent_rank"); static final Name N_PIVOT = systemName("pivot"); static final Name N_PLPGSQL = systemName("plpgsql"); static final Name N_PLUS = systemName("plus"); static final Name N_POWER = systemName("power"); static final Name N_RANDOMBLOB = systemName("randomblob"); - static final Name N_RANK = systemName("rank"); static final Name N_RATIO_TO_REPORT = systemName("ratio_to_report"); static final Name N_RAWTOHEX = systemName("rawtohex"); static final Name N_RECORD = systemName("record"); @@ -444,6 +440,7 @@ final class Names { static final Name N_COUNT = systemName("count"); static final Name N_COVAR_POP = systemName("covar_pop"); static final Name N_COVAR_SAMP = systemName("covar_samp"); + static final Name N_CUME_DIST = systemName("cume_dist"); static final Name N_CURRENTUSER = systemName("currentuser"); static final Name N_CURRENT_CATALOG = systemName("current_catalog"); static final Name N_CURRENT_DATABASE = systemName("current_database"); @@ -456,6 +453,7 @@ final class Names { static final Name N_DB_NAME = systemName("db_name"); static final Name N_DEGREES = systemName("degrees"); static final Name N_DELETING = systemName("deleting"); + static final Name N_DENSE_RANK = systemName("dense_rank"); static final Name N_DIGITS = systemName("digits"); static final Name N_E = systemName("e"); static final Name N_EXCLUDED = systemName("excluded"); @@ -546,6 +544,7 @@ final class Names { static final Name N_OVERLAY = systemName("overlay"); static final Name N_PERCENTILE_CONT = systemName("percentile_cont"); static final Name N_PERCENTILE_DISC = systemName("percentile_disc"); + static final Name N_PERCENT_RANK = systemName("percent_rank"); static final Name N_PI = systemName("pi"); static final Name N_POSITION = systemName("position"); static final Name N_POW = systemName("pow"); @@ -556,6 +555,7 @@ final class Names { static final Name N_RAND = systemName("rand"); static final Name N_RANDOM = systemName("random"); static final Name N_RANDOM_UUID = systemName("random_uuid"); + static final Name N_RANK = systemName("rank"); static final Name N_REGR_AVGX = systemName("regr_avgx"); static final Name N_REGR_AVGY = systemName("regr_avgy"); static final Name N_REGR_COUNT = systemName("regr_count"); diff --git a/jOOQ/src/main/java/org/jooq/impl/PercentRankAgg.java b/jOOQ/src/main/java/org/jooq/impl/PercentRankAgg.java new file mode 100644 index 0000000000..3176eb5ab3 --- /dev/null +++ b/jOOQ/src/main/java/org/jooq/impl/PercentRankAgg.java @@ -0,0 +1,157 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Other licenses: + * ----------------------------------------------------------------------------- + * Commercial licenses for this work are available. These replace the above + * ASL 2.0 and offer limited warranties, support, maintenance, and commercial + * database integrations. + * + * For more information, please visit: https://www.jooq.org/legal/licensing + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + */ +package org.jooq.impl; + +import static org.jooq.impl.DSL.*; +import static org.jooq.impl.Internal.*; +import static org.jooq.impl.Keywords.*; +import static org.jooq.impl.Names.*; +import static org.jooq.impl.SQLDataType.*; +import static org.jooq.impl.Tools.*; +import static org.jooq.impl.Tools.BooleanDataKey.*; +import static org.jooq.impl.Tools.ExtendedDataKey.*; +import static org.jooq.impl.Tools.SimpleDataKey.*; +import static org.jooq.SQLDialect.*; + +import org.jooq.*; +import org.jooq.Function1; +import org.jooq.Record; +import org.jooq.conf.ParamType; +import org.jooq.tools.StringUtils; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashSet; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Set; + +import java.math.BigDecimal; + + +/** + * The PERCENT RANK statement. + */ +@SuppressWarnings({ "rawtypes", "unused" }) +final class PercentRankAgg +extends + AbstractAggregateFunction +implements + QOM.PercentRankAgg +{ + + PercentRankAgg( + Collection> fields + ) { + super( + false, + N_PERCENT_RANK, + NUMERIC, + fields + ); + } + + // ------------------------------------------------------------------------- + // XXX: QueryPart API + // ------------------------------------------------------------------------- + + + + @Override + public final void accept(Context ctx) { + super.accept(ctx); + } + + + + // ------------------------------------------------------------------------- + // XXX: Query Object Model + // ------------------------------------------------------------------------- + + @Override + public final QOM.UnmodifiableList> $fields() { + return QOM.unmodifiable(getArguments()); + } + + @Override + public final QOM.PercentRankAgg $fields(Collection> newValue) { + return $constructor().apply(newValue); + } + + public final Function1>, ? extends QOM.PercentRankAgg> $constructor() { + return (a1) -> new PercentRankAgg((Collection>) a1); + } + + + + + + + + + + + + + + + + + + + + + + + + // ------------------------------------------------------------------------- + // XXX: The Object API + // ------------------------------------------------------------------------- + + @Override + public boolean equals(Object that) { + if (that instanceof QOM.PercentRankAgg o) { + return + StringUtils.equals($fields(), o.$fields()) + ; + } + else + return super.equals(that); + } +} diff --git a/jOOQ/src/main/java/org/jooq/impl/QOM.java b/jOOQ/src/main/java/org/jooq/impl/QOM.java index 892484b80e..4d76627275 100644 --- a/jOOQ/src/main/java/org/jooq/impl/QOM.java +++ b/jOOQ/src/main/java/org/jooq/impl/QOM.java @@ -8231,6 +8231,74 @@ public final class QOM { @NotNull Product $distinct(boolean distinct); } + /** + * The RANK function. + *

+ * The RANK hypothetical set aggregate function. + */ + public /*sealed*/ interface RankAgg + extends + QueryPart, + org.jooq.OrderedAggregateFunction + //permits + // RankAgg + { + @NotNull UnmodifiableList> $fields(); + @CheckReturnValue + @NotNull RankAgg $fields(Collection> fields); + } + + /** + * The DENSE RANK function. + *

+ * The DENSE_RANK hypothetical set aggregate function. + */ + public /*sealed*/ interface DenseRankAgg + extends + QueryPart, + org.jooq.OrderedAggregateFunction + //permits + // DenseRankAgg + { + @NotNull UnmodifiableList> $fields(); + @CheckReturnValue + @NotNull DenseRankAgg $fields(Collection> fields); + } + + /** + * The PERCENT RANK function. + *

+ * The PERCENT_RANK hypothetical set aggregate function. + */ + public /*sealed*/ interface PercentRankAgg + extends + QueryPart, + org.jooq.OrderedAggregateFunction + //permits + // PercentRankAgg + { + @NotNull UnmodifiableList> $fields(); + @CheckReturnValue + @NotNull PercentRankAgg $fields(Collection> fields); + } + + /** + * The CUME DIST function. + *

+ * The CUME_DIST hypothetical set aggregate function. + */ + public /*sealed*/ interface CumeDistAgg + extends + QueryPart, + org.jooq.OrderedAggregateFunction + //permits + // CumeDistAgg + { + @NotNull UnmodifiableList> $fields(); + @CheckReturnValue + @NotNull CumeDistAgg $fields(Collection> fields); + } + /** * The PERCENTILE CONT function. *

diff --git a/jOOQ/src/main/java/org/jooq/impl/RankAgg.java b/jOOQ/src/main/java/org/jooq/impl/RankAgg.java new file mode 100644 index 0000000000..7ac788b2ca --- /dev/null +++ b/jOOQ/src/main/java/org/jooq/impl/RankAgg.java @@ -0,0 +1,156 @@ +/* + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * + * Other licenses: + * ----------------------------------------------------------------------------- + * Commercial licenses for this work are available. These replace the above + * ASL 2.0 and offer limited warranties, support, maintenance, and commercial + * database integrations. + * + * For more information, please visit: https://www.jooq.org/legal/licensing + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + */ +package org.jooq.impl; + +import static org.jooq.impl.DSL.*; +import static org.jooq.impl.Internal.*; +import static org.jooq.impl.Keywords.*; +import static org.jooq.impl.Names.*; +import static org.jooq.impl.SQLDataType.*; +import static org.jooq.impl.Tools.*; +import static org.jooq.impl.Tools.BooleanDataKey.*; +import static org.jooq.impl.Tools.ExtendedDataKey.*; +import static org.jooq.impl.Tools.SimpleDataKey.*; +import static org.jooq.SQLDialect.*; + +import org.jooq.*; +import org.jooq.Function1; +import org.jooq.Record; +import org.jooq.conf.ParamType; +import org.jooq.tools.StringUtils; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.HashSet; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Set; + + + +/** + * The RANK statement. + */ +@SuppressWarnings({ "rawtypes", "unused" }) +final class RankAgg +extends + AbstractAggregateFunction +implements + QOM.RankAgg +{ + + RankAgg( + Collection> fields + ) { + super( + false, + N_RANK, + INTEGER, + fields + ); + } + + // ------------------------------------------------------------------------- + // XXX: QueryPart API + // ------------------------------------------------------------------------- + + + + @Override + public final void accept(Context ctx) { + super.accept(ctx); + } + + + + // ------------------------------------------------------------------------- + // XXX: Query Object Model + // ------------------------------------------------------------------------- + + @Override + public final QOM.UnmodifiableList> $fields() { + return QOM.unmodifiable(getArguments()); + } + + @Override + public final QOM.RankAgg $fields(Collection> newValue) { + return $constructor().apply(newValue); + } + + public final Function1>, ? extends QOM.RankAgg> $constructor() { + return (a1) -> new RankAgg((Collection>) a1); + } + + + + + + + + + + + + + + + + + + + + + + + + // ------------------------------------------------------------------------- + // XXX: The Object API + // ------------------------------------------------------------------------- + + @Override + public boolean equals(Object that) { + if (that instanceof QOM.RankAgg o) { + return + StringUtils.equals($fields(), o.$fields()) + ; + } + else + return super.equals(that); + } +}