mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#1634 ENH: Add convenience expressions "equal to or null" eqOrNull()
This commit is contained in:
@@ -30,6 +30,22 @@ public class TestQueryWhereInRange extends BaseTestCase {
|
||||
assertThat(sqlOf(query)).contains("where (t0.order_date >= ? and t0.order_date < ?) and ");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void eqOrNull() {
|
||||
|
||||
ResetBasicData.reset();
|
||||
|
||||
LocalDate today = LocalDate.now();
|
||||
|
||||
Query<Order> query = DB.find(Order.class)
|
||||
.where().eqOrNull("orderDate", today)
|
||||
.query();
|
||||
|
||||
query.findList();
|
||||
|
||||
assertThat(query.getGeneratedSql()).contains("where (t0.order_date = ? or t0.order_date is null)");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void gtOrNull() {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user