diff --git a/src/main/java/org/springframework/data/jpa/domain/Specification.java b/src/main/java/org/springframework/data/jpa/domain/Specification.java index 8e1d9a601..113d3a270 100644 --- a/src/main/java/org/springframework/data/jpa/domain/Specification.java +++ b/src/main/java/org/springframework/data/jpa/domain/Specification.java @@ -43,9 +43,9 @@ public interface Specification extends Serializable { /** * Negates the given {@link Specification}. * - * @param + * @param the type of the {@link Root} the resulting {@literal Specification} operates on. * @param spec can be {@literal null}. - * @return + * @return guaranteed to be not {@literal null}. * @since 2.0 */ static Specification not(@Nullable Specification spec) { @@ -58,9 +58,9 @@ public interface Specification extends Serializable { /** * Simple static factory method to add some syntactic sugar around a {@link Specification}. * - * @param + * @param the type of the {@link Root} the resulting {@literal Specification} operates on. * @param spec can be {@literal null}. - * @return + * @return guaranteed to be not {@literal null}. * @since 2.0 */ static Specification where(@Nullable Specification spec) { @@ -76,7 +76,7 @@ public interface Specification extends Serializable { */ default Specification and(@Nullable Specification other) { - return composed(this, other, (builder, left, rhs) -> builder.and(left, rhs)); + return composed(this, other, CriteriaBuilder::and); } /** @@ -87,7 +87,7 @@ public interface Specification extends Serializable { * @since 2.0 */ default Specification or(@Nullable Specification other) { - return composed(this, other, (builder, left, rhs) -> builder.or(left, rhs)); + return composed(this, other, CriteriaBuilder::or); } /**