use of org.springframework.data.projection.ProjectionFactory in project spring-data-mongodb by spring-projects.
the class StringBasedMongoQueryUnitTests method createQueryForMethod.
private StringBasedMongoQuery createQueryForMethod(String name, Class<?>... parameters) {
try {
Method method = SampleRepository.class.getMethod(name, parameters);
ProjectionFactory factory = new SpelAwareProxyProjectionFactory();
MongoQueryMethod queryMethod = new MongoQueryMethod(method, new DefaultRepositoryMetadata(SampleRepository.class), factory, converter.getMappingContext());
return new StringBasedMongoQuery(queryMethod, operations, PARSER, DefaultEvaluationContextProvider.INSTANCE);
} catch (Exception e) {
throw new IllegalArgumentException(e.getMessage(), e);
}
}
Aggregations