mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#1182 - Error when applied disjunction to filterMany
This commit is contained in:
@@ -9,6 +9,7 @@ import org.tests.model.basic.ResetBasicData;
|
||||
import org.ebeantest.LoggedSqlCollector;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.util.List;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
@@ -42,6 +43,25 @@ public class TestQueryFilterMany extends BaseTestCase {
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testDisjunction() {
|
||||
|
||||
ResetBasicData.reset();
|
||||
|
||||
LoggedSqlCollector.start();
|
||||
|
||||
Ebean.find(Customer.class)
|
||||
.filterMany("orders")
|
||||
.or()
|
||||
.eq("status", Order.Status.NEW)
|
||||
.eq("orderDate", LocalDate.now())
|
||||
.findList();
|
||||
|
||||
List<String> sql = LoggedSqlCollector.stop();
|
||||
assertEquals(2, sql.size());
|
||||
assertThat(sql.get(1)).contains("and (t0.status = ? or t0.order_date = ?");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testNestedFilterMany() {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user