Skip to content

Commit 59f4d51

Browse files
author
Thomas Darimont
committed
DATACMNS-636 - Add 'exists' method to QueryDslPredicateExecutor which accepts a querydsl Predicate.
Introduced exists(Predicate) method to QueryDslPredicateExecutor which enables other SD Repository implementations to provide this functionality without users having to manually declare the method on their interfaces.
1 parent 32a6f0d commit 59f4d51

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/main/java/org/springframework/data/querydsl/QueryDslPredicateExecutor.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2011-2014 the original author or authors.
2+
* Copyright 2011-2015 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -83,4 +83,12 @@ public interface QueryDslPredicateExecutor<T> {
8383
* @return the number of instances matching the {@link Predicate}.
8484
*/
8585
long count(Predicate predicate);
86+
87+
/**
88+
* Checks whether the data store contains elements that match the given {@link Predicate}.
89+
*
90+
* @param predicate the {@link Predicate} to use for the existance check, can be {@literal null}.
91+
* @return {@literal true} if the data store contains elements that match the given {@link Predicate}.
92+
*/
93+
boolean exists(Predicate predicate);
8694
}

0 commit comments

Comments
 (0)