use of io.micronaut.data.jpa.operations.JpaRepositoryOperations in project micronaut-data by micronaut-projects.
the class LoadInterceptor method intercept.
@Override
public T intercept(RepositoryMethodKey methodKey, MethodInvocationContext<T, T> context) {
Serializable id = (Serializable) Arrays.stream(context.getParameterValues()).findFirst().orElseThrow(() -> new IllegalArgumentException("id argument cannot be null"));
Class<T> returnType = context.getReturnType().getType();
return ((JpaRepositoryOperations) operations).load(returnType, id);
}
Aggregations