From 9756c9133ed019e92ce9bae2c3e7fdc4299c5ec7 Mon Sep 17 00:00:00 2001 From: Rob Bygrave Date: Sat, 19 Aug 2023 13:46:45 +1200 Subject: [PATCH] Improve existing test for filterMany using raw with separate SQL query for filterMany --- .../test/java/org/tests/query/TestQueryFilterMany.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/ebean-test/src/test/java/org/tests/query/TestQueryFilterMany.java b/ebean-test/src/test/java/org/tests/query/TestQueryFilterMany.java index 75d158c882..0ebf2bdc6b 100644 --- a/ebean-test/src/test/java/org/tests/query/TestQueryFilterMany.java +++ b/ebean-test/src/test/java/org/tests/query/TestQueryFilterMany.java @@ -134,18 +134,22 @@ public void filterMany_firstMaxRows_expressionFluidStyle() { } @Test - public void test_with_findOne() { - + public void test_with_findOne_rawSeparateQuery() { ResetBasicData.reset(); + LoggedSql.start(); Customer customer = DB.find(Customer.class) .setMaxRows(1) .order().asc("id") .fetch("orders") - .filterMany("orders").raw("1 = 0") + .filterMany("orders").raw("orderDate is not null") .findOne(); assertThat(customer).isNotNull(); + List sql = LoggedSql.stop(); + assertThat(sql).hasSize(2); + assertThat(sql.get(0)).contains("from o_customer t0 order by"); + assertThat(sql.get(1)).contains("from o_order t0 join o_customer t1 on t1.id = t0.kcustomer_id where"); } @Test