mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#2145 - SoftDelete predicate missing on join to ManyToOne supporting predicate expression
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user