mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
No effective change - add a test for filterMany with isNotEmpty()
This commit is contained in:
@@ -74,6 +74,31 @@ public class TestQueryFilterMany extends BaseTestCase {
|
||||
assertThat(customer).isPresent();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void test_filterMany_with_isNotEmpty() {
|
||||
|
||||
ResetBasicData.reset();
|
||||
|
||||
LoggedSqlCollector.start();
|
||||
|
||||
Query<Customer> query = Ebean.find(Customer.class)
|
||||
.fetch("orders")
|
||||
.filterMany("orders").raw("1=0")
|
||||
.where().isNotEmpty("orders")
|
||||
.query();
|
||||
|
||||
List<Customer> list = query.findList();
|
||||
for (Customer customer : list) {
|
||||
assertThat(customer.getOrders()).isEmpty();
|
||||
}
|
||||
|
||||
List<String> sqlList = LoggedSqlCollector.stop();
|
||||
assertEquals(2, sqlList.size());
|
||||
assertThat(sqlList.get(0)).contains("where exists (select 1 from o_order x where x.kcustomer_id = t0.id)");
|
||||
assertThat(sqlList.get(1)).contains("and 1=0");
|
||||
}
|
||||
|
||||
|
||||
@Test
|
||||
public void test_filterMany_in_findCount() {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user