Refactor BeanPropertyAssocMany findByParentIds use of raw expression

This commit is contained in:
Robin Bygrave
2016-07-12 16:01:32 +12:00
parent 675c51b8c1
commit d8dfd66af3
5 changed files with 63 additions and 21 deletions
@@ -75,7 +75,8 @@ public class TestOnCascadeDeleteChildrenWithCompositeKeys extends BaseTestCase {
assertEquals(0, Ebean.find(User.class).findList().size());
}
@Test public void testFindByParentIdList() {
@Test
public void testFindByParentIdList() {
if (isMsSqlServer()) return;
@@ -92,7 +93,8 @@ public class TestOnCascadeDeleteChildrenWithCompositeKeys extends BaseTestCase {
ids.add(1L);
ids.add(2L);
beanProperty.findIdsByParentId(null, ids, null, null);
beanProperty.findIdsByParentId(null, ids, null, null);
beanProperty.findIdsByParentId(1L, null, null, null);
}
@Entity @Table(name = "em_user") public static class User {
@@ -15,6 +15,8 @@ import com.avaje.tests.model.basic.Order;
import com.avaje.tests.model.basic.OrderDetail;
import com.avaje.tests.model.basic.ResetBasicData;
import static org.assertj.core.api.Assertions.assertThat;
public class TestManyLazyLoadingQuery extends BaseTestCase {
@Test
@@ -55,6 +57,7 @@ public class TestManyLazyLoadingQuery extends BaseTestCase {
beanProperty.addWhereParentIdIn(query0, parentIds, false);
query0.findList();
assertThat(query0.getGeneratedSql()).contains(" from o_order_detail t0 where (t0.order_id) in (");
} finally {
Ebean.endTransaction();