Search in sources :

Example 1 with FindWithQuery

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

the class AbstractMongoQuery method doExecute.

/**
 * Execute the {@link RepositoryQuery} of the given method with the parameters provided by the
 * {@link ConvertingParameterAccessor accessor}
 *
 * @param method the {@link MongoQueryMethod} invoked. Never {@literal null}.
 * @param processor {@link ResultProcessor} for post procession. Never {@literal null}.
 * @param accessor for providing invocation arguments. Never {@literal null}.
 * @param typeToRead the desired component target type. Can be {@literal null}.
 */
protected Object doExecute(MongoQueryMethod method, ResultProcessor processor, ConvertingParameterAccessor accessor, @Nullable Class<?> typeToRead) {
    Query query = createQuery(accessor);
    applyQueryMetaAttributesWhenPresent(query);
    query = applyAnnotatedDefaultSortIfPresent(query);
    query = applyAnnotatedCollationIfPresent(query, accessor);
    FindWithQuery<?> find = // 
    typeToRead == null ? // 
    executableFind : executableFind.as(typeToRead);
    return getExecution(accessor, find).execute(query);
}
Also used : FindWithQuery(org.springframework.data.mongodb.core.ExecutableFindOperation.FindWithQuery) Query(org.springframework.data.mongodb.core.query.Query) RepositoryQuery(org.springframework.data.repository.query.RepositoryQuery)

Aggregations

FindWithQuery (org.springframework.data.mongodb.core.ExecutableFindOperation.FindWithQuery)1 Query (org.springframework.data.mongodb.core.query.Query)1 RepositoryQuery (org.springframework.data.repository.query.RepositoryQuery)1