File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
src/main/java/org/springframework/data/domain Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change 2828 * over using {@literal null} or {@link java.util.Optional#empty()} to indicate the absence of an actual {@link Limit}.
2929 * </p>
3030 * {@link Limit} itself does not make assumptions about the actual {@link #max()} value sign. This means that a negative
31- * value may be valid within a defined context.
31+ * value may be valid within a defined context. A zero limit can be useful in cases where the result is not needed but
32+ * the underlying activity to compute results might be required.
33+ * <p>
34+ * Note that using a zero Limit with repository query methods returning {@link Page} is rejected because of a zero-page
35+ * size.
3236 *
3337 * @author Christoph Strobl
3438 * @author Oliver Drotbohm
@@ -104,8 +108,7 @@ public boolean equals(@Nullable Object obj) {
104108 return false ;
105109 }
106110
107- return this .isUnlimited () && that .isUnlimited ()
108- || max () == that .max ();
111+ return this .isUnlimited () && that .isUnlimited () || max () == that .max ();
109112 }
110113
111114 @ Override
You can’t perform that action at this time.
0 commit comments