mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-23 07:11:55 +00:00
#1189 - ExpressionList.isNull and SoftDelete
This commit is contained in:
1 parent
e75670f207
commit
0dbba7a211
7 files changed
+47
-25
No files matched your search
@@ -2,6 +2,7 @@ package org.tests.softdelete;
|
||||
|
||||
import io.ebean.BaseTestCase;
|
||||
import io.ebean.Ebean;
|
||||
import io.ebean.Query;
|
||||
import io.ebean.Transaction;
|
||||
import io.ebean.annotation.PersistBatch;
|
||||
import org.tests.model.softdelete.ESoftDelMid;
|
||||
@@ -12,6 +13,8 @@ import org.junit.Test;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
public class TestSoftDeleteTop extends BaseTestCase {
|
||||
|
||||
@Test
|
||||
@@ -89,4 +92,22 @@ public class TestSoftDeleteTop extends BaseTestCase {
|
||||
Ebean.deletePermanent(top1);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testWhereNull() {
|
||||
|
||||
ESoftDelTop top1 = new ESoftDelTop("top1");
|
||||
top1.addMids("mid1");
|
||||
top1.addMids("mid2");
|
||||
|
||||
Ebean.save(top1);
|
||||
|
||||
Query<ESoftDelTop> query = Ebean.find(ESoftDelTop.class)
|
||||
.where().isEmpty("mids")
|
||||
.query();
|
||||
|
||||
query.findList();
|
||||
|
||||
assertThat(sqlOf(query)).contains("where not exists (select 1 from esoft_del_mid x where x.top_id = t0.id and x.deleted =)");
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user