File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
spring-data-jpa/src/main/java/org/springframework/data/jpa/domain Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -44,6 +44,16 @@ public interface Specification<T> extends Serializable {
44
44
45
45
@ Serial long serialVersionUID = 1L ;
46
46
47
+ /**
48
+ * Simple static factory method to create a specification matching all objects.
49
+ *
50
+ * @param <T> the type of the {@link Root} the resulting {@literal Specification} operates on.
51
+ * @return guaranteed to be not {@literal null}.
52
+ */
53
+ static <T > Specification <T > unrestricted () {
54
+ return (root , query , builder ) -> null ;
55
+ }
56
+
47
57
/**
48
58
* Negates the given {@link Specification}.
49
59
*
@@ -72,7 +82,8 @@ static <T> Specification<T> not(@Nullable Specification<T> spec) {
72
82
* @param spec can be {@literal null}.
73
83
* @return guaranteed to be not {@literal null}.
74
84
* @since 2.0
75
- * @deprecated since 3.5, to be removed with 4.0 as we no longer want to support {@literal null} specifications.
85
+ * @deprecated since 3.5, to be removed with 4.0 as we no longer want to support {@literal null} specifications. Use
86
+ * {@link #unrestricted()} instead.
76
87
*/
77
88
@ Deprecated (since = "3.5.0" , forRemoval = true )
78
89
static <T > Specification <T > where (@ Nullable Specification <T > spec ) {
You can’t perform that action at this time.
0 commit comments