use of org.springframework.data.repository.query.ResultProcessor in project spring-data-mongodb by spring-projects.
the class AbstractMongoQuery method execute.
/*
* (non-Javadoc)
* @see org.springframework.data.repository.query.RepositoryQuery#execute(java.lang.Object[])
*/
@Override
public Object execute(Object[] parameters) {
ConvertingParameterAccessor accessor = new ConvertingParameterAccessor(operations.getConverter(), new MongoParametersParameterAccessor(method, parameters));
ResultProcessor processor = method.getResultProcessor().withDynamicProjection(accessor);
Class<?> typeToRead = processor.getReturnedType().getTypeToRead();
return processor.processResult(doExecute(method, processor, accessor, typeToRead));
}
use of org.springframework.data.repository.query.ResultProcessor in project spring-data-mongodb by spring-projects.
the class AbstractReactiveMongoQuery method execute.
private Publisher<Object> execute(MongoParameterAccessor parameterAccessor) {
ConvertingParameterAccessor accessor = new ConvertingParameterAccessor(operations.getConverter(), parameterAccessor);
TypeInformation<?> returnType = method.getReturnType();
ResultProcessor processor = method.getResultProcessor().withDynamicProjection(accessor);
Class<?> typeToRead = processor.getReturnedType().getTypeToRead();
if (typeToRead == null && returnType.getComponentType() != null) {
typeToRead = returnType.getComponentType().getType();
}
return doExecute(method, processor, accessor, typeToRead);
}
Aggregations