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
// DEFAULT AND COMPACT SYNTAX COMPARED | |
// for each example the default and compact syntax are shown | |
// select single | |
query.from(survey).select(survey.id) // default | |
survey.select(_.id) // compact | |
// select single 2 | |
query.from(employee).select(employee.firstname) |
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 = alias(Person.class); | |
List<Person> persons = query.from($(p)) | |
.where($(p.getName()).eq("Jason").and( | |
$(p.getAge()).gt(10)).and( | |
$(p.getCountry()).like("Canad*")).or( | |
$(p.getName()).eq("Dhanji").and( | |
$(p.getCountry()).ne("Canada")))) | |
.list($(p)); |
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
(ns synth | |
(include "cmath" | |
"lv2/lv2plug.in/ns/lv2core/lv2.h")) | |
(defstruct Synth | |
(sample-rate double) | |
(phase float) | |
(freq float*) | |
(output float*)) |
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
#1 | |
e1.or(e2).and(e3)) | |
creates at first an 'or' operation based on e1 and e2 and uses this 'or' operation | |
in a top level 'and' operation with e3 as the second operand. | |
Since 'and' has higher precedence than 'or' it is serialized as | |
(e1 or e2) and e3 |