DATACMNS-410 - Fixed bug in ReflectionRepositoryInvoker#invokeFindOne.

We now delegate calls to invokeFindOne to the correct target repository.

Original pull request: #80.
This commit is contained in:
Thomas Darimont
2013-12-13 12:24:38 +01:00
committed by Oliver Gierke
parent 11f1207e4e
commit f148d19c81
3 changed files with 67 additions and 6 deletions

View File

@@ -29,6 +29,7 @@ import org.springframework.util.ReflectionUtils;
* information.
*
* @author Oliver Gierke
* @author Thomas Darimont
* @since 1.6
*/
class ReflectionRepositoryInvoker<T> implements CrudInvoker<T> {
@@ -72,6 +73,6 @@ class ReflectionRepositoryInvoker<T> implements CrudInvoker<T> {
@Override
@SuppressWarnings("unchecked")
public T invokeFindOne(Serializable id) {
return (T) ReflectionUtils.invokeMethod(methods.getFindOneMethod(), id);
return (T) ReflectionUtils.invokeMethod(methods.getFindOneMethod(), repository, id);
}
}