DATACMNS-867 - RepositoryInvoker now returns an Optional for invokeFindOne(…).

Adapted ReflectionRepositoryInvoker to transparently unwrap other potentially used wrapper types to then convert the result into an Optional.
This commit is contained in:
Oliver Gierke
2017-03-21 11:50:50 +01:00
parent dec820d6c2
commit fee153f724
7 changed files with 47 additions and 13 deletions

View File

@@ -17,6 +17,7 @@ package org.springframework.data.querydsl;
import java.io.Serializable;
import java.lang.reflect.Method;
import java.util.Optional;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
@@ -125,7 +126,7 @@ public class QuerydslRepositoryInvokerAdapter implements RepositoryInvoker {
* @see org.springframework.data.repository.support.RepositoryInvoker#invokeFindOne(java.io.Serializable)
*/
@Override
public <T> T invokeFindOne(Serializable id) {
public <T> Optional<T> invokeFindOne(Serializable id) {
return delegate.invokeFindOne(id);
}