Created
November 4, 2012 22:51
-
-
Save dhanji/4014182 to your computer and use it in GitHub Desktop.
Completely type-safe query-DSL for Java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Person p = query.topic(Person.class); | |
List<Person> results = query.from(p) | |
.where(p.getName(), is("Jason")) | |
.and(p.getAge(), greaterThan(10)) | |
.and(p.getCountry(), like("Canad*")) | |
.or() | |
.where(p.getName(), is("Dhanji")) | |
.and(p.getCountry(), not("Canada")) | |
.list(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment