#2145 - SoftDelete predicate missing on join to ManyToOne supporting predicate expression

This commit is contained in:
rob bygrave
2021-01-20 00:00:27 +13:00
parent 7f68b9d846
commit 0c1657fef5
5 changed files with 48 additions and 19 deletions
@@ -137,6 +137,27 @@ public class TestSoftDeleteBasic extends BaseTestCase {
query.delete();
}
@Test
public void testFindChild_joinParent() {
EBasicSoftDelete bean = new EBasicSoftDelete();
bean.setName("softDelParent_withChild");
bean.addChild("child1", 10);
DB.save(bean);
Query<EBasicSDChild> query = DB.find(EBasicSDChild.class)
.where()
.eq("owner.name", "softDelParent_withChild")
.query();
List<EBasicSDChild> list = query.findList();
assertSql(query).contains("join ebasic_soft_delete t1 on t1.id = t0.owner_id and t1.deleted =");
assertThat(list).hasSize(1);
// Cleanup created entity
DB.deletePermanent(bean);
}
@Test
public void testFindSoftDeletedList() {
EBasicSoftDelete bean = new EBasicSoftDelete();