コード例 #1
0
 @SuppressWarnings("unchecked")
 protected Object dispatchQuery(
     String queryString, Map<String, Object> params, ParameterAccessor accessor) {
   GraphQueryMethod queryMethod = getQueryMethod();
   final QueryEngine<?> queryEngine = getQueryEngine();
   final Class<?> compoundType = queryMethod.getCompoundType();
   if (queryMethod.isPageQuery()) {
     @SuppressWarnings("unchecked")
     final Iterable<?> result = queryEngine.query(queryString, params).to(compoundType);
     return createPage(result, accessor.getPageable());
   }
   if (queryMethod.isIterableResult()) {
     return queryEngine.query(queryString, params).to(compoundType);
   }
   return queryEngine.query(queryString, params).to(queryMethod.getReturnType()).singleOrNull();
 }
コード例 #2
0
 @Override
 public Object execute(Object[] parameters) {
   final ParameterAccessor accessor =
       new ParametersParameterAccessor(queryMethod.getParameters(), parameters);
   Map<String, Object> params = resolveParams(accessor);
   final String queryString = createQueryWithPagingAndSorting(accessor);
   return dispatchQuery(queryString, params, accessor);
 }
コード例 #3
0
 protected String createQueryWithPagingAndSorting(ParameterAccessor accessor) {
   return queryMethod.getQueryString();
 }
コード例 #4
0
 protected Map<String, Object> resolveParams(ParameterAccessor accessor) {
   return queryMethod.resolveParams(accessor, this);
 }