Package org.springframework.data.repository.query

Examples of org.springframework.data.repository.query.ParameterAccessor


      List<Long> totals = projection.getResultList();
      Long total = totals.size() == 1 ? totals.get(0) : totals.size();

      Query query = repositoryQuery.createQuery(values);
      ParameterAccessor accessor = new ParametersParameterAccessor(parameters, values);
      Pageable pageable = accessor.getPageable();

      List<Object> content = pageable == null || total > pageable.getOffset() ? query.getResultList() : Collections
          .emptyList();

      return new PageImpl<Object>(content, pageable, total);
View Full Code Here


   * @see org.springframework.data.jpa.repository.query.AbstractJpaQuery#doCreateQuery(java.lang.Object[])
   */
  @Override
  public Query doCreateQuery(Object[] values) {

    ParameterAccessor accessor = new ParametersParameterAccessor(getQueryMethod().getParameters(), values);
    String sortedQueryString = QueryUtils.applySorting(query.getQueryString(), accessor.getSort(), query.getAlias());

    Query query = createJpaQuery(sortedQueryString);

    return createBinder(values).bindAndPrepare(query);
  }
View Full Code Here

     * @see org.springframework.data.jpa.repository.query.AbstractJpaQuery#createQuery(java.lang.Object[])
     */
    @Override
    public Query doCreateQuery(Object[] values) {

        ParameterAccessor accessor = new ParametersParameterAccessor(method.getParameters(), values);
        String sortedQueryString = QueryUtils.applySorting(query.getQuery(), accessor.getSort(), query.getAlias());
        EntityManager em = getEntityManager();

        Query query = null;

        if (method.isNativeQuery()) {
View Full Code Here

    @Override
    public Object execute(final Object[] parameters) {
        return template.exec(new GraphCallback<Object>() {
            @Override
            public Object doWithGraph(GraphDatabase graph) throws Exception {
                final ParameterAccessor accessor = new ParametersParameterAccessor(queryMethod.getParameters(), parameters);
                Map<String, Object> params = resolveParams(accessor);
                final String queryString = createQueryWithPagingAndSorting(accessor);
                return dispatchQuery(queryString, params, accessor);
            }
        });
View Full Code Here

TOP

Related Classes of org.springframework.data.repository.query.ParameterAccessor

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.