Conversation
52ee55f to
61e6d36
Compare
|
LGTM |
| return (root, query, builder) -> { | ||
|
|
||
| Predicate not = spec.toPredicate(root, query, builder); | ||
| return not != null ? builder.not(not) : null; |
There was a problem hiding this comment.
That's so many not's, it's making knots in my brain. Could we at least reverse the comparison?
| static <T> Specification<T> anyOf(Iterable<Specification<T>> specifications) { | ||
|
|
||
| return StreamSupport.stream(specifications.spliterator(), false) // | ||
| .reduce(Specification.all(), Specification::or); |
There was a problem hiding this comment.
This looks really wrong to me. Specification.all() suggests a Specification that produces true for all inputs, which would always yield true when combined by OR with anything else.
I'd say the underlying problem is that all() is a misnomer. It should really be Specification.null() or Specification.empty(), shouldn't it?
There was a problem hiding this comment.
I updated the name to unrestricted() to express really what it does.
| public interface UpdateSpecification<T> extends Serializable { | ||
|
|
||
| /** | ||
| * Simple static factory method to create a specification deleting all objects. |
There was a problem hiding this comment.
I assume that should read "updating all objects"
| * @param spec must not be {@literal null}. | ||
| * @return guaranteed to be not {@literal null}. | ||
| */ | ||
| static <T> UpdateOperation<T> update(UpdateOperation<T> spec) { |
There was a problem hiding this comment.
Comments and error message talk about UpdateSpecification but the types used are UpdateOperation. I'm confused.
Introduce DeleteSpecification and UpdateSpecification. Add PredicateSpecification. Update SpecificationExecutor.
Gentle reminder to deprecate where before we remove it here
Revise nullability requirements around non-nullable specifications.
The where method will be removed with next major version containing some refinements in the Specification API. See: #3578
Revise nullability requirements around non-nullable specifications. Original Pull Request: #3578
Also remove serialVersionUID. Original Pull Request: #3578
Revise nullability requirements around non-nullable specifications. Original Pull Request: #3578
Also remove serialVersionUID. Original Pull Request: #3578
Revise nullability requirements around non-nullable specifications. Original Pull Request: #3578
Introduce
DeleteSpecificationandUpdateSpecification. AddPredicateSpecification. UpdateSpecificationExecutor.See #3521