I want an Ebean equivalent of this SQL Statement
SELECT A,B,C FROM TABLE1 WHERE A BETWEEN "X" AND "Y"
I have the Ebean Avaje Documentation with simple queries example
Any help is appreciated. Thanks in advance :)
I want an Ebean equivalent of this SQL Statement
SELECT A,B,C FROM TABLE1 WHERE A BETWEEN "X" AND "Y"
I have the Ebean Avaje Documentation with simple queries example
Any help is appreciated. Thanks in advance :)
De facto it's in API, also there are some samples in my answer to ... my question :)
Edit:
To perform what you want with Ebean API, just use... between(propertyName, value1, value2)
i.e.:
List<Foo> foos = Foo.find.where().between("bar", 5, 10).findList();
And if you want to get only specified foo
, bar
properties, additionally use select("comma,separated,list")
List<Foo> foos = Foo.find.select("foo, bar").where().between("bar", 5, 10).findList();
Note, that using finder with select("list")
always adds the id
property to the list (and also discriminator if used), even if they are not explicitly added to the list.