Package org.conserve.sort

Examples of org.conserve.sort.Order


        {
          Clause[] subClauses = where.getSubclauses();
          // handle LIMIT and OFFSET clauses
          if (where instanceof Order)
          {
            Order order = (Order) where;
            if (order.getLimit() != null)
            {
              if (sp.getLimit() == null)
              {
                sp.setLimit(order.getLimit());
                if (order.getOffset() != null)
                {
                  if (sp.getOffset() == null)
                  {
                    sp.setOffset(order.getOffset());
                  }
                  else
                  {
                    throw new IllegalArgumentException("Multiple offsets defined.");
                  }
View Full Code Here


    List<SimplestObject> list = persist.getObjectsMatching(new SimplestObject());
    assertEquals(200, list.size());
    // select using sorting
    SimplestObject orderObject = new SimplestObject();
    orderObject.setFoo(0.0);
    list = persist.getObjects(SimplestObject.class, new Order(20, 10, new Ascending(orderObject)));
    assertEquals(20, list.size());
    assertEquals((Double) 10.0, list.get(0).getFoo());
    list = persist.getObjects(SimplestObject.class, new Order(45, new Ascending(orderObject)));
    assertEquals(45, list.size());
    assertEquals((Double) 0.0, list.get(0).getFoo());

    persist.close();
  }
View Full Code Here

TOP

Related Classes of org.conserve.sort.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.