Package com.pardot.rhombus

Examples of com.pardot.rhombus.Criteria


    result = om.getByKey(objectType, id);
    assertEquals("0", result.get("value"));
    assertNull(result.get("index_2"));

    //Query back the data by first index
    Criteria criteria = new Criteria();
    SortedMap<String, Object> indexKeys = new TreeMap<String, Object>();
    indexKeys.put("index_1", "value1");
    criteria.setIndexKeys(indexKeys);
    criteria.setOrdering("DESC");
    criteria.setLimit(50l);
    List<Map<String, Object>> dbObjects = om.list(objectType, criteria);
    assertEquals(1, dbObjects.size());
    assertEquals(null, dbObjects.get(0).get("index_2"));

    //Query back the data by second index
    criteria = new Criteria();
    indexKeys = new TreeMap<String, Object>();
    indexKeys.put("index_2", "value2");
    criteria.setIndexKeys(indexKeys);
    criteria.setOrdering("DESC");
    criteria.setLimit(50l);
    dbObjects = om.list(objectType, criteria);
    assertEquals(0, dbObjects.size());

    cm.teardown();
  }
View Full Code Here


    updates.put("object_id", UUID.fromString("00000003-0000-0030-0040-000000040000"));
    om.update("object_audit", id, updates);


    //Query back the data
    Criteria criteria = new Criteria();
    SortedMap<String, Object> indexKeys = new TreeMap<String, Object>();
    indexKeys.put("account_id", UUID.fromString("00000003-0000-0030-0040-000000030000"));
    indexKeys.put("object_id", UUID.fromString("00000003-0000-0030-0040-000000040000"));
    indexKeys.put("object_type", "Account");
    criteria.setIndexKeys(indexKeys);
    criteria.setOrdering("DESC");
    criteria.setLimit(50l);

    List<Map<String, Object>> dbObjects = om.list("object_audit", criteria);
    assertEquals(1, dbObjects.size());

    cm.teardown();
View Full Code Here

      // generate a executorIterator
      SortedMap<String, Object> indexValues = Maps.newTreeMap();
      indexValues.put("account_id", UUID.fromString("00000003-0000-0030-0040-000000030000"));
      indexValues.put("user_id", UUID.fromString("00000003-0000-0030-0040-000000030000"));
      Criteria criteria = new Criteria();
      criteria.setIndexKeys(indexValues);

      CObjectCQLGenerator cqlGenerator = om.getCqlGenerator_ONLY_FOR_TESTING();
      CQLStatementIterator unBoundedIterator = cqlGenerator.makeCQLforList(objectType, criteria, false);

      Session session = cm.getRhombusSession(definition);
View Full Code Here

TOP

Related Classes of com.pardot.rhombus.Criteria

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.