DATAKV-186 - SimpleKeyValueRepository.existsById(…) now evaluates findById(…) results properly.

ExistsById now evaluates Optional.isPresent() instead of comparing findById result to null.

Original Pull Request: #24
This commit is contained in:
EugeneNik
2017-07-19 23:49:12 +04:00
committed by Christoph Strobl
parent 256bb16dba
commit c5e0d1a26c
2 changed files with 13 additions and 1 deletions

View File

@@ -132,7 +132,7 @@ public class SimpleKeyValueRepository<T, ID extends Serializable> implements Key
*/
@Override
public boolean existsById(ID id) {
return findById(id) != null;
return findById(id).isPresent();
}
/*