Skip to content

Instantly share code, notes, and snippets.

@krisskross
Created May 18, 2012 17:05
Show Gist options
  • Save krisskross/2726441 to your computer and use it in GitHub Desktop.
Save krisskross/2726441 to your computer and use it in GitHub Desktop.
InMemoryStorage storage = new InMemoryStorage();
// add a few Item.class objects to storage
Criteria middleprice = field("price").is(largerThan(100)).and(lessThan(200));
Criteria expired = field("expires").is(after(currentDate));
Collection<Item> result = storage.select(middleprice.and(not(expired))).from(Item.class);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment