Add support for executing derived existsBy queries.
Closes: #385 Original pull request: #386.
This commit is contained in:
committed by
Mark Paluch
parent
8f1c0ece24
commit
8c32f0ae6d
@@ -139,6 +139,8 @@ public class KeyValuePartTreeQuery implements RepositoryQuery {
|
||||
|
||||
Iterable<?> result = this.keyValueOperations.find(query, queryMethod.getEntityInformation().getJavaType());
|
||||
return result.iterator().hasNext() ? result.iterator().next() : null;
|
||||
} else if (new PartTree(queryMethod.getName(), queryMethod.getEntityInformation().getJavaType()).isExistsProjection()) {
|
||||
return keyValueOperations.count(query, queryMethod.getEntityInformation().getJavaType()) > 0;
|
||||
}
|
||||
|
||||
throw new UnsupportedOperationException("Query method not supported.");
|
||||
|
||||
Reference in New Issue
Block a user