Package com.google.apphosting.datastore.DatastoreV3Pb.Query

Examples of com.google.apphosting.datastore.DatastoreV3Pb.Query.Order


  private static List<Order> makeAdjustedOrders(List<Order> orders, List<Filter> filters) {
    List<Order> existsOrders = Lists.newArrayList();
    for (Filter filter : filters) {
      if (filter.getOpEnum() == Filter.Operator.EXISTS) {
        existsOrders.add(new Order()
            .setProperty(filter.getProperty(0).getName())
            .setDirection(Direction.ASCENDING));
      }
    }
    Collections.sort(existsOrders, ORDER_PROPERTY_COMPARATOR);

    List<Order> adjusted = new ArrayList<Order>(orders.size() + existsOrders.size() + 1);
    adjusted.addAll(orders);

    if (adjusted.isEmpty()) {
      for (Filter filter : filters) {
        if (ValidatedQuery.INEQUALITY_OPERATORS.contains(filter.getOpEnum())) {
          adjusted.add(new Order()
            .setProperty(filter.getProperty(0).getName())
            .setDirection(Direction.ASCENDING));
          break;
        }
      }
View Full Code Here

TOP

Related Classes of com.google.apphosting.datastore.DatastoreV3Pb.Query.Order

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.