mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#1611 - ENH: Add inRange expression (as half open expression) ... (property >= lowerValue and property < upperValue)
Add inrange to EQL grammer
This commit is contained in:
@@ -274,6 +274,26 @@ public class EqlParserTest extends BaseTestCase {
|
||||
platformAssertIn(query.getGeneratedSql(),"where t0.name");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void where_inrange() {
|
||||
|
||||
Query<Customer> query = parse("where name inrange 'As' to 'B'");
|
||||
query.findList();
|
||||
|
||||
assertThat(query.getGeneratedSql()).contains("where (t0.name >= ? and t0.name < ?) ");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void where_inrange_withNamedParams() {
|
||||
|
||||
Query<Customer> query = parse("where name inrange :one to :two");
|
||||
query.setParameter("one", "a");
|
||||
query.setParameter("two", "b");
|
||||
query.findList();
|
||||
|
||||
assertThat(query.getGeneratedSql()).contains("where (t0.name >= ? and t0.name < ?)");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void where_between() {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user