Package org.springframework.data.domain

Examples of org.springframework.data.domain.Sort


    if (fields.length == 0) {
      return null;
    }

    Sort sort = new Sort(sortDefault.direction(), fields);
    return sortOrNull == null ? sort : sortOrNull.and(sort);
  }
View Full Code Here


        allOrders.add(new Order(direction, property));
      }
    }

    return allOrders.isEmpty() ? null : new Sort(allOrders);
  }
View Full Code Here

   * (non-Javadoc)
   * @see javax.xml.bind.annotation.adapters.XmlAdapter#unmarshal(java.lang.Object)
   */
  @Override
  public Sort unmarshal(SortDto source) {
    return source == null ? null : new Sort(SpringDataJaxb.unmarshal(source.orders, OrderAdapter.INSTANCE));
  }
View Full Code Here

    // Limit lower bound
    pageSize = pageSize < 1 ? defaultOrFallback.getPageSize() : pageSize;
    // Limit upper bound
    pageSize = pageSize > maxPageSize ? maxPageSize : pageSize;

    Sort sort = sortResolver.resolveArgument(methodParameter, mavContainer, webRequest, binderFactory);
    return new PageRequest(page, pageSize, sort == null ? defaultOrFallback.getSort() : sort);
  }
View Full Code Here

      return new PageRequest(v.page, v.size);
    }

    SortDto sortDto = new SortDto();
    sortDto.orders = v.orders;
    Sort sort = SortAdapter.INSTANCE.unmarshal(sortDto);

    return new PageRequest(v.page, v.size, sort);
  }
View Full Code Here

    if (parameters.isEmpty()) {
      return new Object[0];
    }

    Object[] result = new Object[parameters.size()];
    Sort sortToUse = pageable == null ? sort : pageable.getSort();

    for (int i = 0; i < result.length; i++) {

      MethodParameter param = parameters.get(i);
      Class<?> targetType = param.getParameterType();
View Full Code Here

    if (Pageable.class.isAssignableFrom(types[0])) {
      return invoke(method, pageable);
    }

    Sort sort = pageable == null ? null : pageable.getSort();

    return invokeFindAll(sort);
  }
View Full Code Here

   * Returns the clause as {@link Sort}.
   *
   * @return the {@link Sort} or null if no orders found.
   */
  public Sort toSort() {
    return this.orders.isEmpty() ? null : new Sort(this.orders);
  }
View Full Code Here

    if (!(value instanceof Sort)) {
      return;
    }

    Sort sort = (Sort) value;
    String sortParameter = getSortParameter(parameter);

    builder.replaceQueryParam(sortParameter);

    for (String expression : foldIntoExpressions(sort)) {
View Full Code Here

    if (annotatedDefault != null) {
      return appendOrCreateSortTo(annotatedDefault, null);
    }

    if (annotatedDefaults != null) {
      Sort sort = null;
      for (SortDefault currentAnnotatedDefault : annotatedDefaults.value()) {
        sort = appendOrCreateSortTo(currentAnnotatedDefault, sort);
      }
      return sort;
    }
View Full Code Here

TOP

Related Classes of org.springframework.data.domain.Sort

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.