From 97da2154f39b28b0847a894b4741a7284bd29285 Mon Sep 17 00:00:00 2001 From: Lukas Eder Date: Mon, 12 Dec 2022 09:52:17 +0100 Subject: [PATCH] [jOOQ/jOOQ#13640] Added more Javadoc --- .../jooq/impl/AbstractDelegatingTable.java | 5 +- .../main/java/org/jooq/impl/HintedTable.java | 2 + .../main/java/org/jooq/impl/LinkedTable.java | 3 + jOOQ/src/main/java/org/jooq/impl/QOM.java | 118 +++++++++++++++++- 4 files changed, 126 insertions(+), 2 deletions(-) diff --git a/jOOQ/src/main/java/org/jooq/impl/AbstractDelegatingTable.java b/jOOQ/src/main/java/org/jooq/impl/AbstractDelegatingTable.java index 32dc566952..1ab32abfa8 100644 --- a/jOOQ/src/main/java/org/jooq/impl/AbstractDelegatingTable.java +++ b/jOOQ/src/main/java/org/jooq/impl/AbstractDelegatingTable.java @@ -48,7 +48,10 @@ import org.jooq.impl.QOM.Aliasable; /** * @author Lukas Eder */ -abstract class AbstractDelegatingTable extends AbstractTable { +abstract class AbstractDelegatingTable +extends + AbstractTable +{ final AbstractTable delegate; diff --git a/jOOQ/src/main/java/org/jooq/impl/HintedTable.java b/jOOQ/src/main/java/org/jooq/impl/HintedTable.java index fb584de7e8..05d36259b1 100644 --- a/jOOQ/src/main/java/org/jooq/impl/HintedTable.java +++ b/jOOQ/src/main/java/org/jooq/impl/HintedTable.java @@ -46,6 +46,8 @@ import org.jooq.Record; import org.jooq.Table; // ... +import org.jetbrains.annotations.NotNull; + /** * @author Lukas Eder */ diff --git a/jOOQ/src/main/java/org/jooq/impl/LinkedTable.java b/jOOQ/src/main/java/org/jooq/impl/LinkedTable.java index 7c76441841..2640d0098c 100644 --- a/jOOQ/src/main/java/org/jooq/impl/LinkedTable.java +++ b/jOOQ/src/main/java/org/jooq/impl/LinkedTable.java @@ -110,6 +110,9 @@ package org.jooq.impl; + + + diff --git a/jOOQ/src/main/java/org/jooq/impl/QOM.java b/jOOQ/src/main/java/org/jooq/impl/QOM.java index fb147fed1f..91f49d1362 100644 --- a/jOOQ/src/main/java/org/jooq/impl/QOM.java +++ b/jOOQ/src/main/java/org/jooq/impl/QOM.java @@ -64,6 +64,7 @@ import org.jooq.CheckReturnValue; import org.jooq.Collation; import org.jooq.Comment; import org.jooq.CommonTableExpression; +import org.jooq.Comparator; import org.jooq.Condition; import org.jooq.Constraint; import org.jooq.DDLQuery; @@ -106,6 +107,7 @@ import org.jooq.JSONEntry; import org.jooq.Keyword; // ... import org.jooq.Name; +import org.jooq.Operator; import org.jooq.OrderField; import org.jooq.Param; import org.jooq.Parameter; @@ -242,11 +244,26 @@ public final class QOM { permits TupleImpl2 { + + /** + * The first value in the tuple. + */ @NotNull Q1 $1(); + + /** + * The second value in the tuple. + */ @NotNull Q2 $2(); + /** + * Set the first value in the tuple. + */ @CheckReturnValue @NotNull Tuple2 $1(Q1 newPart1); + + /** + * Set the second value in the tuple. + */ @CheckReturnValue @NotNull Tuple2 $2(Q2 newPart2); } @@ -261,6 +278,10 @@ public final class QOM { permits AbstractQueryPartMap { + + /** + * Get the {@link #entrySet()} of this map as a list of tuples. + */ @NotNull UnmodifiableList> $tuples(); } @@ -290,6 +311,9 @@ public final class QOM { // TODO: These methods could return unmodifiable views instead, to avoid // copying things around... + /** + * Collect the contents of this list using a {@link Collector}. + */ default R $collect(Collector collector) { return stream().collect(collector); } @@ -404,6 +428,10 @@ public final class QOM { } } + /** + * A WITH clause of a {@link Select}, {@link Insert}, + * {@link Update}, or {@link Delete} statement. + */ public /*sealed*/ interface With extends org.jooq.QueryPart @@ -414,11 +442,23 @@ public final class QOM { boolean $recursive(); } + /** + * A {@link QueryPart} that may associate an {@link #$alias()} with the + * {@link #$aliased()} part. + */ public interface Aliasable extends org.jooq.QueryPart { + + /** + * The aliased part (a {@link Field} or a {@link Table}). + */ @NotNull Q $aliased(); + + /** + * The alias if any. + */ @Nullable Name $alias(); } @@ -426,6 +466,9 @@ public final class QOM { // XXX: Queries // ------------------------------------------------------------------------- + /** + * The INSERT statement. + */ public sealed interface Insert extends DMLQuery @@ -470,6 +513,9 @@ public final class QOM { @NotNull Insert $updateWhere(Condition where); } + /** + * An INSERT statement with a RETURNING clause. + */ public sealed interface InsertReturning extends ResultQuery @@ -484,6 +530,9 @@ public final class QOM { @NotNull InsertReturning $returning(Collection returning); } + /** + * The UPDATE statement. + */ public sealed interface Update extends DMLQuery @@ -512,6 +561,9 @@ public final class QOM { @NotNull Update $limit(Field limit); } + /** + * An UPDATE statement with a RETURNING clause. + */ public sealed interface UpdateReturning extends ResultQuery @@ -526,6 +578,9 @@ public final class QOM { @NotNull UpdateReturning $returning(Collection returning); } + /** + * The DELETE statement. + */ public sealed interface Delete extends DMLQuery @@ -551,6 +606,9 @@ public final class QOM { @NotNull Delete $limit(Field limit); } + /** + * An DELETE statement with a RETURNING clause. + */ public sealed interface DeleteReturning extends ResultQuery @@ -565,6 +623,9 @@ public final class QOM { @NotNull DeleteReturning $returning(Collection returning); } + /** + * The CREATE TYPE statement. + */ public /*sealed*/ interface CreateType extends DDLQuery @@ -575,6 +636,9 @@ public final class QOM { @NotNull UnmodifiableList> $values(); } + /** + * The DROP TYPE statement. + */ public /*sealed*/ interface DropType extends DDLQuery @@ -586,6 +650,9 @@ public final class QOM { @Nullable Cascade $cascade(); } + /** + * The CREATE VIEW statement. + */ public /*sealed*/ interface CreateView extends DDLQuery @@ -617,8 +684,40 @@ public final class QOM { - public interface HintedTable extends Table { + + + + + + + + + + + + + + + + + + + + + + + + /** + * A table with a MySQL style index access hint. + */ + public sealed interface HintedTable + extends + Table + permits + org.jooq.impl.HintedTable + { @NotNull Table $table(); + @CheckReturnValue @NotNull HintedTable $table(Table newTable); } @@ -720,6 +819,10 @@ public final class QOM { // XXX: Conditions // ------------------------------------------------------------------------- + /** + * A {@link Condition} consisting of two {@link Condition} operands and a + * binary logic {@link Operator}. + */ public /*sealed*/ interface CombinedCondition extends Condition, @@ -729,6 +832,10 @@ public final class QOM { MOr*/ {} + /** + * A {@link Condition} consisting of two {@link Field} operands and a + * {@link Comparator} operator. + */ public /*sealed*/ interface CompareCondition extends Condition, @@ -750,6 +857,9 @@ public final class QOM { MEndsWithIgnoreCase*/ {} + /** + * The BETWEEN predicate. + */ public interface Between extends Condition, @@ -759,6 +869,9 @@ public final class QOM { @NotNull Between $symmetric(boolean symmetric); } + /** + * The IN predicate accepting a list of values. + */ public /*sealed*/ interface InList extends Condition, @@ -770,6 +883,9 @@ public final class QOM { @NotNull default UnmodifiableList> $list() { return $arg2(); } } + /** + * The NOT IN predicate accepting a list of values. + */ public /*sealed*/ interface NotInList extends Condition,