use of org.springframework.data.repository.query.QueryMethodEvaluationContextProvider in project spring-cloud-gcp by spring-cloud.
the class DatastoreRepositoryFactory method delegateContextProvider.
private QueryMethodEvaluationContextProvider delegateContextProvider(QueryMethodEvaluationContextProvider evaluationContextProvider) {
return new QueryMethodEvaluationContextProvider() {
@Override
public <T extends Parameters<?, ?>> EvaluationContext getEvaluationContext(T parameters, Object[] parameterValues) {
StandardEvaluationContext evaluationContext = (StandardEvaluationContext) evaluationContextProvider.getEvaluationContext(parameters, parameterValues);
evaluationContext.setRootObject(DatastoreRepositoryFactory.this.applicationContext);
evaluationContext.addPropertyAccessor(new BeanFactoryAccessor());
evaluationContext.setBeanResolver(new BeanFactoryResolver(DatastoreRepositoryFactory.this.applicationContext));
return evaluationContext;
}
};
}
use of org.springframework.data.repository.query.QueryMethodEvaluationContextProvider in project spring-cloud-gcp by spring-cloud.
the class SpannerRepositoryFactory method delegateContextProvider.
private QueryMethodEvaluationContextProvider delegateContextProvider(QueryMethodEvaluationContextProvider evaluationContextProvider) {
return new QueryMethodEvaluationContextProvider() {
@Override
public <T extends Parameters<?, ?>> EvaluationContext getEvaluationContext(T parameters, Object[] parameterValues) {
StandardEvaluationContext evaluationContext = (StandardEvaluationContext) evaluationContextProvider.getEvaluationContext(parameters, parameterValues);
evaluationContext.setRootObject(SpannerRepositoryFactory.this.applicationContext);
evaluationContext.addPropertyAccessor(new BeanFactoryAccessor());
evaluationContext.setBeanResolver(new BeanFactoryResolver(SpannerRepositoryFactory.this.applicationContext));
return evaluationContext;
}
};
}
Aggregations