Skip to content

Instantly share code, notes, and snippets.

@cosbor11
Last active September 4, 2015 04:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cosbor11/8f3268b973accf3524d7 to your computer and use it in GitHub Desktop.
Save cosbor11/8f3268b973accf3524d7 to your computer and use it in GitHub Desktop.
onyx query
//Execute a query to see your entity in the collection
QueryCriteria criteria = new QueryCriteria("firstName", QueryCriteriaOperator.EQUAL, "Michael");
Query query = new Query(Person.class, criteria);
query.setMaxResults(20);
List<Person> people = manager.executeQuery(query);
//There should be 1 person in the list named "Michael"
System.out.println("records returned: " + people.size());
System.out.println("first person in the list: " + people.get(0).getFirstName() + " " + people.get(0).getLastName());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment