Package org.springframework.data.elasticsearch.core.query

Examples of org.springframework.data.elasticsearch.core.query.StringQuery


  }

  @Override
  public Object execute(Object[] parameters) {
    ParametersParameterAccessor accessor = new ParametersParameterAccessor(queryMethod.getParameters(), parameters);
    StringQuery stringQuery = createQuery(accessor);
    if (queryMethod.isPageQuery()) {
      stringQuery.setPageable(accessor.getPageable());
      return elasticsearchOperations.queryForPage(stringQuery, queryMethod.getEntityInformation().getJavaType());
    } else if (queryMethod.isCollectionQuery()) {
      if (accessor.getPageable() != null) {
        stringQuery.setPageable(accessor.getPageable());
      }
      return elasticsearchOperations.queryForList(stringQuery, queryMethod.getEntityInformation().getJavaType());
    }

    return elasticsearchOperations.queryForObject(stringQuery, queryMethod.getEntityInformation().getJavaType());
View Full Code Here


    return elasticsearchOperations.queryForObject(stringQuery, queryMethod.getEntityInformation().getJavaType());
  }

  protected StringQuery createQuery(ParametersParameterAccessor parameterAccessor) {
    String queryString = replacePlaceholders(this.query, parameterAccessor);
    return new StringQuery(queryString);
  }
View Full Code Here

    }

    @Override
    public Object execute(Object[] parameters) {
        ParametersParameterAccessor accessor = new ParametersParameterAccessor(queryMethod.getParameters(), parameters);
        StringQuery stringQuery = createQuery(accessor);
        if(queryMethod.isPageQuery()){
            stringQuery.setPageable(accessor.getPageable());
            return  elasticsearchOperations.queryForPage(stringQuery, queryMethod.getEntityInformation().getJavaType());
        } else if(queryMethod.isCollectionQuery()) {
            if(accessor.getPageable() != null) {
                stringQuery.setPageable(accessor.getPageable());
            }
            return elasticsearchOperations.queryForList(stringQuery,queryMethod.getEntityInformation().getJavaType());
        }

        return elasticsearchOperations.queryForObject(stringQuery, queryMethod.getEntityInformation().getJavaType());
View Full Code Here

    }


    protected StringQuery createQuery(ParametersParameterAccessor parameterAccessor) {
        String queryString = replacePlaceholders(this.query, parameterAccessor);
        return new StringQuery(queryString);
    }
View Full Code Here

TOP

Related Classes of org.springframework.data.elasticsearch.core.query.StringQuery

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.