Package org.springframework.data.domain.Sort

Examples of org.springframework.data.domain.Sort.Direction


      if (part == null) {
        continue;
      }

      String[] elements = part.split(delimiter);
      Direction direction = elements.length == 0 ? null : Direction.fromStringOrNull(elements[elements.length - 1]);

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

        if (i == elements.length - 1 && direction != null) {
          continue;
View Full Code Here


    List<String> expressions = new ArrayList<String>();
    ExpressionBuilder builder = null;

    for (Order order : sort) {

      Direction direction = order.getDirection();

      if (builder == null) {
        builder = new ExpressionBuilder(direction);
      } else if (!builder.hasSameDirectionAs(order)) {
        builder.dumpExpressionIfPresentInto(expressions);
View Full Code Here

    List<String> expressions = new ArrayList<String>();
    ExpressionBuilder builder = null;

    for (Order order : sort) {

      Direction direction = order.getDirection();

      if (builder == null) {
        builder = new ExpressionBuilder(direction);
      } else if (!builder.hasSameDirectionAs(order)) {
        throw new IllegalArgumentException(String.format(
View Full Code Here

    for (String part : clause.split(BLOCK_SPLIT)) {
      Matcher matcher = DIRECTION_SPLIT.matcher(part);
      if (!matcher.find()) {
        throw new IllegalArgumentException(String.format("Invalid order syntax for part %s!", part));
      }
      Direction direction = Direction.fromString(matcher.group(2));
      this.orders.add(createOrder(matcher.group(1), direction, domainClass));
    }
  }
View Full Code Here

    for (Part part : tree.getParts()) {
      if (GEOSPATIAL_TYPES.contains(part.getType())) {
        return;
      }
      String property = part.getProperty().toDotPath();
      Direction order = toDirection(sort, property);
      index.on(property, order);
    }

    // Add fixed sorting criteria to index
    if (sort != null) {
      for (Sort.Order order : sort) {
        index.on(order.getProperty(), order.getDirection());
      }
    }

    MongoEntityMetadata<?> metadata = query.getQueryMethod().getEntityInformation();
    operations.indexOps(metadata.getCollectionName()).ensureIndex(index);
View Full Code Here

TOP

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

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.