-1

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 :)

Incpetor
  • 1,293
  • 6
  • 25
  • 46

1 Answers1

0

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.

Community
  • 1
  • 1
biesior
  • 55,576
  • 10
  • 125
  • 182
  • @thanks biesior I actually referred your question as a part of my research.. unfortunately I am restricted to use Ebean model example.. (dbfinder is finder object) dbfinder.find.where().ilike("name").. I am searching for something like this dbfinder.find.between(). thanks again :) – Incpetor Mar 30 '14 at 06:37
  • Ach, didn't realize what are you asking about then – biesior Mar 31 '14 at 05:38