Search in sources :

Example 1 with FindWithQuery

use of org.springframework.data.mongodb.core.ReactiveFindOperation.FindWithQuery in project spring-data-mongodb by spring-projects.

the class AbstractReactiveMongoQuery method execute.

private Object execute(MongoParameterAccessor parameterAccessor) {
    Query query = createQuery(new ConvertingParameterAccessor(operations.getConverter(), parameterAccessor));
    applyQueryMetaAttributesWhenPresent(query);
    ResultProcessor processor = method.getResultProcessor().withDynamicProjection(parameterAccessor);
    Class<?> typeToRead = processor.getReturnedType().getTypeToRead();
    FindWithQuery<?> find = // 
    typeToRead == null ? // 
    findOperationWithProjection : findOperationWithProjection.as(typeToRead);
    String collection = method.getEntityInformation().getCollectionName();
    ReactiveMongoQueryExecution execution = getExecution(query, parameterAccessor, new ResultProcessingConverter(processor, operations, instantiators), find);
    return execution.execute(query, processor.getReturnedType().getDomainType(), collection);
}
Also used : Query(org.springframework.data.mongodb.core.query.Query) FindWithQuery(org.springframework.data.mongodb.core.ReactiveFindOperation.FindWithQuery) RepositoryQuery(org.springframework.data.repository.query.RepositoryQuery) ResultProcessingConverter(org.springframework.data.mongodb.repository.query.ReactiveMongoQueryExecution.ResultProcessingConverter) ResultProcessor(org.springframework.data.repository.query.ResultProcessor)

Aggregations

FindWithQuery (org.springframework.data.mongodb.core.ReactiveFindOperation.FindWithQuery)1 Query (org.springframework.data.mongodb.core.query.Query)1 ResultProcessingConverter (org.springframework.data.mongodb.repository.query.ReactiveMongoQueryExecution.ResultProcessingConverter)1 RepositoryQuery (org.springframework.data.repository.query.RepositoryQuery)1 ResultProcessor (org.springframework.data.repository.query.ResultProcessor)1