From 45c57acbb47389e579b654fec003dbcf32e4c258 Mon Sep 17 00:00:00 2001 From: Jens Schauder Date: Fri, 24 Sep 2021 10:15:48 +0200 Subject: [PATCH] Fix JavaDoc. Self closing

tags cause build failures now. Closes #1059 --- .../relational/core/conversion/DbAction.java | 7 +++---- .../relational/core/mapping/Embedded.java | 10 +++++---- .../mapping/event/BeforeDeleteCallback.java | 2 +- .../data/relational/core/sql/AssignValue.java | 4 ++-- .../core/sql/AsteriskFromTable.java | 11 ++++++++-- .../data/relational/core/sql/Between.java | 5 +++-- .../data/relational/core/sql/Column.java | 5 +++-- .../data/relational/core/sql/Comparison.java | 3 ++- .../relational/core/sql/DeleteValidator.java | 5 +++-- .../data/relational/core/sql/Join.java | 5 +++-- .../data/relational/core/sql/Like.java | 4 ++-- .../data/relational/core/sql/SQL.java | 5 +++-- .../data/relational/core/sql/Segment.java | 15 +++++++------ .../relational/core/sql/SelectValidator.java | 4 ++-- .../data/relational/core/sql/Table.java | 4 ++-- .../data/relational/core/sql/TableLike.java | 10 ++++----- .../relational/core/sql/UpdateBuilder.java | 2 +- .../relational/core/sql/package-info.java | 5 +++-- .../core/sql/render/DelegatingVisitor.java | 21 ++++++++++++------- .../sql/render/FilteredSubtreeVisitor.java | 5 +++-- .../core/sql/render/TypedSubtreeVisitor.java | 5 +++-- 21 files changed, 81 insertions(+), 56 deletions(-) diff --git a/spring-data-relational/src/main/java/org/springframework/data/relational/core/conversion/DbAction.java b/spring-data-relational/src/main/java/org/springframework/data/relational/core/conversion/DbAction.java index 126d1ad67..5fab2db4b 100644 --- a/spring-data-relational/src/main/java/org/springframework/data/relational/core/conversion/DbAction.java +++ b/spring-data-relational/src/main/java/org/springframework/data/relational/core/conversion/DbAction.java @@ -236,7 +236,7 @@ public interface DbAction { *

* Note that deletes for contained entities that reference the root are to be represented by separate * {@link DbAction}s. - * + *

* @param type of the entity for which this represents a database interaction. */ final class DeleteRoot implements DbAction { @@ -300,7 +300,7 @@ public interface DbAction { *

* Note that deletes for contained entities that reference the root are to be represented by separate * {@link DbAction}s. - * + *

* @param type of the entity for which this represents a database interaction. */ final class DeleteAllRoot implements DbAction { @@ -322,7 +322,6 @@ public interface DbAction { /** * Represents an acquire lock statement for a aggregate root when only the ID is known. - *

* * @param type of the entity for which this represents a database interaction. */ @@ -392,7 +391,7 @@ public interface DbAction { * Additional values to be set during insert or update statements. *

* Values come from parent entities but one might also add values manually. - * + *

* @return guaranteed to be not {@code null}. */ Map, Object> getQualifiers(); diff --git a/spring-data-relational/src/main/java/org/springframework/data/relational/core/mapping/Embedded.java b/spring-data-relational/src/main/java/org/springframework/data/relational/core/mapping/Embedded.java index d6e5c2572..269135eb5 100644 --- a/spring-data-relational/src/main/java/org/springframework/data/relational/core/mapping/Embedded.java +++ b/spring-data-relational/src/main/java/org/springframework/data/relational/core/mapping/Embedded.java @@ -27,10 +27,11 @@ import org.springframework.core.annotation.AliasFor; /** * The annotation to configure a value object as embedded in the current table. - *

+ *

* Depending on the {@link OnEmpty value} of {@link #onEmpty()} the property is set to {@literal null} or an empty * instance in the case all embedded values are {@literal null} when reading from the result set. - * + *

+ * * @author Bastian Wilhelm * @author Christoph Strobl * @since 1.1 @@ -42,9 +43,10 @@ public @interface Embedded { /** * Set the load strategy for the embedded object if all contained fields yield {@literal null} values. - *

+ *

* {@link Nullable @Embedded.Nullable} and {@link Empty @Embedded.Empty} offer shortcuts for this. - * + *

+ * * @return never {@link} null. */ OnEmpty onEmpty(); diff --git a/spring-data-relational/src/main/java/org/springframework/data/relational/core/mapping/event/BeforeDeleteCallback.java b/spring-data-relational/src/main/java/org/springframework/data/relational/core/mapping/event/BeforeDeleteCallback.java index f377246c5..3af35073f 100644 --- a/spring-data-relational/src/main/java/org/springframework/data/relational/core/mapping/event/BeforeDeleteCallback.java +++ b/spring-data-relational/src/main/java/org/springframework/data/relational/core/mapping/event/BeforeDeleteCallback.java @@ -37,7 +37,7 @@ public interface BeforeDeleteCallback extends EntityCallback { * account for deleting. Only transient fields of the entity should be changed in this callback. * * @param aggregate the aggregate. - * @param aggregateChange the associated {@link DefaultAggregateChange}. + * @param aggregateChange the associated {@link MutableAggregateChange}. * @return the aggregate to be deleted. */ T onBeforeDelete(T aggregate, MutableAggregateChange aggregateChange); diff --git a/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/AssignValue.java b/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/AssignValue.java index 21de0676d..301571688 100644 --- a/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/AssignValue.java +++ b/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/AssignValue.java @@ -19,9 +19,9 @@ import org.springframework.util.Assert; /** * Assign a {@link Expression} to a {@link Column}. - *

+ *

* Results in a rendered assignment: {@code = } (e.g. {@code col = 'foo'}. - * + *

* @author Mark Paluch * @since 1.1 */ diff --git a/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/AsteriskFromTable.java b/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/AsteriskFromTable.java index b2af696f3..4ad577f9f 100644 --- a/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/AsteriskFromTable.java +++ b/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/AsteriskFromTable.java @@ -17,8 +17,15 @@ package org.springframework.data.relational.core.sql; /** * {@link Segment} to select all columns from a {@link Table}. - *

- * Renders to: {@code .*} as in {@code SELECT
.* FROM …}. + *

+ * Renders to: {@code + * +

+ * .*} as in {@code SELECT + * +
+ * .* FROM …}. + *

* * @author Mark Paluch * @since 1.1 diff --git a/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/Between.java b/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/Between.java index ef3f03f81..d9f82788a 100644 --- a/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/Between.java +++ b/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/Between.java @@ -19,9 +19,10 @@ import org.springframework.util.Assert; /** * BETWEEN {@link Condition} comparing between {@link Expression}s. - *

+ *

* Results in a rendered condition: {@code BETWEEN AND }. - * + *

+ * * @author Mark Paluch * @since 2.2 */ diff --git a/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/Column.java b/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/Column.java index 71f3ab2d5..beb20fd3c 100644 --- a/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/Column.java +++ b/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/Column.java @@ -20,9 +20,10 @@ import org.springframework.util.Assert; /** * Column name within a {@code SELECT … FROM} clause. - *

+ *

* Renders to: {@code } or {@code .}. - * + *

+ * * @author Mark Paluch * @author Jens Schauder * @since 1.1 diff --git a/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/Comparison.java b/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/Comparison.java index 196315c05..94b093d9b 100644 --- a/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/Comparison.java +++ b/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/Comparison.java @@ -19,8 +19,9 @@ import org.springframework.util.Assert; /** * Comparing {@link Condition} comparing two {@link Expression}s. - *

+ *

* Results in a rendered condition: {@code } (e.g. {@code col = 'predicate'}. + *

* * @author Mark Paluch * @author Jens Schauder diff --git a/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/DeleteValidator.java b/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/DeleteValidator.java index 30c29e558..bf3871e70 100644 --- a/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/DeleteValidator.java +++ b/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/DeleteValidator.java @@ -17,9 +17,10 @@ package org.springframework.data.relational.core.sql; /** * Validator for {@link Delete} statements. - *

+ *

* Validates that all {@link Column}s using a table qualifier have a table import from the {@code FROM} clause. - * + *

+ * * @author Mark Paluch * @since 1.1 */ diff --git a/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/Join.java b/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/Join.java index 8adfea514..32494e403 100644 --- a/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/Join.java +++ b/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/Join.java @@ -17,12 +17,13 @@ package org.springframework.data.relational.core.sql; /** * {@link Segment} for a {@code JOIN} declaration. - *

+ *

* Renders to: {@code JOIN *

* ON }. - * + *

+ * * @author Mark Paluch * @since 1.1 */ diff --git a/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/Like.java b/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/Like.java index 826275553..192316c52 100644 --- a/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/Like.java +++ b/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/Like.java @@ -19,9 +19,9 @@ import org.springframework.util.Assert; /** * LIKE {@link Condition} comparing two {@link Expression}s. - *

+ *

* Results in a rendered condition: {@code LIKE }. - * + *

* @author Mark Paluch * @since 1.1 */ diff --git a/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/SQL.java b/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/SQL.java index 79c8f556d..9a85cbb9c 100644 --- a/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/SQL.java +++ b/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/SQL.java @@ -22,9 +22,10 @@ import org.springframework.util.Assert; /** * Utility to create SQL {@link Segment}s. Typically used as entry point to the Statement Builder. Objects and dependent * objects created by the Query AST are immutable except for builders. - *

+ *

* The Statement Builder API is intended for framework usage to produce SQL required for framework operations. - * + *

+ * * @author Mark Paluch * @author Jens Schauder * @since 1.1 diff --git a/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/Segment.java b/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/Segment.java index 09cd2cfe0..5d53ce20a 100644 --- a/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/Segment.java +++ b/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/Segment.java @@ -26,9 +26,10 @@ public interface Segment extends Visitable { /** * Check whether this {@link Segment} is equal to another {@link Segment}. - *

+ *

* Equality is typically given if the {@link #toString()} representation matches. - * + *

+ * * @param other the reference object with which to compare. * @return {@literal true} if this object is the same as the {@code other} argument; {@literal false} otherwise. */ @@ -37,10 +38,11 @@ public interface Segment extends Visitable { /** * Generate a hash code from this{@link Segment}. - *

+ *

* Hashcode typically derives from the {@link #toString()} representation so two {@link Segment}s yield the same * {@link #hashCode()} if their {@link #toString()} representation matches. - * + *

+ * * @return a hash code value for this object. */ @Override @@ -48,11 +50,12 @@ public interface Segment extends Visitable { /** * Return a SQL string representation of this {@link Segment}. - *

+ *

* The representation is intended for debugging purposes and an approximation to the generated SQL. While it might * work in the context of a specific dialect, you should not assume that the {@link #toString()} representation works across * multiple databases. - * + *

+ * * @return a SQL string representation of this {@link Segment}. */ @Override diff --git a/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/SelectValidator.java b/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/SelectValidator.java index e95936bdd..dd0288ec8 100644 --- a/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/SelectValidator.java +++ b/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/SelectValidator.java @@ -21,10 +21,10 @@ import java.util.Stack; /** * Validator for {@link Select} statements. - *

+ *

* Validates that all {@link Column}s using a table qualifier have a table import from either the {@code FROM} or * {@code JOIN} clause. - * + *

* @author Mark Paluch * @author Jens Schauder * @since 1.1 diff --git a/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/Table.java b/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/Table.java index 39b289284..cae55b7d3 100644 --- a/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/Table.java +++ b/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/Table.java @@ -20,8 +20,9 @@ import org.springframework.util.Assert; /** * Represents a table reference within a SQL statement. Typically used to denote {@code FROM} or {@code JOIN} or to * prefix a {@link Column}. - *

+ *

* Renders to: {@code } or {@code AS }. + *

* * @author Mark Paluch * @since 1.1 @@ -107,7 +108,6 @@ public class Table extends AbstractSegment implements TableLike { return new AliasedTable(name, alias); } - /* * (non-Javadoc) * @see org.springframework.data.relational.core.sql.Named#getName() diff --git a/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/TableLike.java b/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/TableLike.java index 46491dbe3..1f6e07285 100644 --- a/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/TableLike.java +++ b/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/TableLike.java @@ -31,7 +31,7 @@ import org.springframework.util.Assert; public interface TableLike extends Segment { /** * Creates a new {@link Column} associated with this {@link Table}. - *

+ *

* Note: This {@link Table} does not track column creation and there is no possibility to enumerate all * {@link Column}s that were created for this table. * @@ -47,7 +47,7 @@ public interface TableLike extends Segment { /** * Creates a new {@link Column} associated with this {@link Table}. - *

+ *

* Note: This {@link Table} does not track column creation and there is no possibility to enumerate all * {@link Column}s that were created for this table. * @@ -64,7 +64,7 @@ public interface TableLike extends Segment { /** * Creates a {@link List} of {@link Column}s associated with this {@link Table}. - *

+ *

* Note: This {@link Table} does not track column creation and there is no possibility to enumerate all * {@link Column}s that were created for this table. * @@ -80,7 +80,7 @@ public interface TableLike extends Segment { /** * Creates a {@link List} of {@link Column}s associated with this {@link Table}. - *

+ *

* Note: This {@link Table} does not track column creation and there is no possibility to enumerate all * {@link Column}s that were created for this table. * @@ -102,7 +102,7 @@ public interface TableLike extends Segment { /** * Creates a {@link List} of {@link Column}s associated with this {@link Table}. - *

+ *

* Note: This {@link Table} does not track column creation and there is no possibility to enumerate all * {@link Column}s that were created for this table. * diff --git a/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/UpdateBuilder.java b/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/UpdateBuilder.java index 5c944e237..cca9d3a3d 100644 --- a/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/UpdateBuilder.java +++ b/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/UpdateBuilder.java @@ -29,7 +29,7 @@ public interface UpdateBuilder { /** * Configure the {@link Table} to which the update is applied. * - * @param count the top count. + * @param table the table to update. * @return {@code this} {@link SelectBuilder}. */ UpdateAssign table(Table table); diff --git a/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/package-info.java b/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/package-info.java index a68018609..7332ca9a7 100644 --- a/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/package-info.java +++ b/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/package-info.java @@ -3,9 +3,10 @@ * Statement Builder implementation. Use {@link org.springframework.data.relational.core.sql.StatementBuilder} to create * statements and {@link org.springframework.data.relational.core.sql.SQL} to create SQL objects. Objects and dependent * objects created by the Statement Builder are immutable except for builders. - *

+ *

* The Statement Builder API is intended for framework usage to produce SQL required for framework operations. - * + *

+ * * @since 1.1 */ @NonNullApi diff --git a/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/render/DelegatingVisitor.java b/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/render/DelegatingVisitor.java index f61b25c1a..b106d18f7 100644 --- a/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/render/DelegatingVisitor.java +++ b/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/render/DelegatingVisitor.java @@ -26,18 +26,21 @@ import org.springframework.util.Assert; * Abstract base class for delegating {@link Visitor} implementations. This class implements a delegation pattern using * visitors. A delegating {@link Visitor} can implement {@link #doEnter(Visitable)} and {@link #doLeave(Visitable)} * methods to provide its functionality. - *

+ *

*

Delegation

Typically, a {@link Visitor} is scoped to a single responsibility. If a {@link Visitor segment} * requires {@link #doEnter(Visitable) processing} that is not directly implemented by the visitor itself, the current * {@link Visitor} can delegate processing to a {@link DelegatingVisitor delegate}. Once a delegation is installed, the * {@link DelegatingVisitor delegate} is used as {@link Visitor} for the current and all subsequent items until it * {@link #doLeave(Visitable) signals} that it is no longer responsible. - *

+ *

+ *

* Nested visitors are required to properly signal once they are no longer responsible for a {@link Visitor segment} to * step back from the delegation. Otherwise, parents are no longer involved in the visitation. - *

+ *

+ *

* Delegation is recursive and limited by the stack size. - * + *

+ * * @author Mark Paluch * @since 1.1 * @see FilteredSubtreeVisitor @@ -49,11 +52,12 @@ abstract class DelegatingVisitor implements Visitor { /** * Invoked for a {@link Visitable segment} when entering the segment. - *

+ *

* This method can signal whether it is responsible for handling the {@link Visitor segment} or whether the segment * requires delegation to a sub-{@link Visitor}. When delegating to a sub-{@link Visitor}, {@link #doEnter(Visitable)} * is called on the {@link DelegatingVisitor delegate}. - * + *

+ * * @param segment must not be {@literal null}. * @return */ @@ -86,11 +90,12 @@ abstract class DelegatingVisitor implements Visitor { /** * Invoked for a {@link Visitable segment} when leaving the segment. - *

+ *

* This method can signal whether this {@link Visitor} should remain responsible for handling subsequent * {@link Visitor segments} or whether it should step back from delegation. When stepping back from delegation, * {@link #doLeave(Visitable)} is called on the {@link DelegatingVisitor parent delegate}. - * + *

+ * * @param segment must not be {@literal null}. * @return */ diff --git a/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/render/FilteredSubtreeVisitor.java b/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/render/FilteredSubtreeVisitor.java index 7ea1d95c7..433071483 100644 --- a/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/render/FilteredSubtreeVisitor.java +++ b/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/render/FilteredSubtreeVisitor.java @@ -25,7 +25,7 @@ import org.springframework.lang.Nullable; * Filtering {@link DelegatingVisitor visitor} applying a {@link Predicate filter}. Typically used as base class for * {@link Visitor visitors} that wish to apply hierarchical processing based on a well-defined entry {@link Visitor * segment}. - *

+ *

* Filtering is a three-way process: *

    *
  1. Ignores elements that do not match the filter {@link Predicate}.
  2. @@ -35,7 +35,8 @@ import org.springframework.lang.Nullable; * children of the matched {@link Visitable} until {@link #leaveMatched(Visitable) leaving the matched} * {@link Visitable}. *
- * + *

+ * * @author Mark Paluch * @see TypedSubtreeVisitor * @since 1.1 diff --git a/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/render/TypedSubtreeVisitor.java b/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/render/TypedSubtreeVisitor.java index 1d64b7edd..7b828dc3d 100644 --- a/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/render/TypedSubtreeVisitor.java +++ b/spring-data-relational/src/main/java/org/springframework/data/relational/core/sql/render/TypedSubtreeVisitor.java @@ -26,7 +26,7 @@ import org.springframework.lang.Nullable; * Type-filtering {@link DelegatingVisitor visitor} applying a {@link Class type filter} derived from the generic type * parameter. Typically used as base class for {@link Visitor visitors} that wish to apply hierarchical processing based * on a well-defined entry {@link Visitor segment}. - *

+ *

* Filtering is a three-way process: *

    *
  1. Ignores elements that do not match the filter {@link Predicate}.
  2. @@ -36,7 +36,8 @@ import org.springframework.lang.Nullable; * children of the matched {@link Visitable} until {@link #leaveMatched(Visitable) leaving the matched} * {@link Visitable}. *
- * + *

+ * * @author Mark Paluch * @since 1.1 * @see FilteredSubtreeVisitor