mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-12-01 15:37:14 +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
@@ -23,7 +23,7 @@ public class IsEmptyExpressionQueryTest extends BaseTestCase {
|
||||
.query();
|
||||
|
||||
query.findList();
|
||||
assertThat(sqlOf(query)).contains("select t0.id from o_customer t0 where not exists (select 1 from contact where customer_id = t0.id");
|
||||
assertThat(sqlOf(query)).contains("select t0.id from o_customer t0 where not exists (select 1 from contact x where x.customer_id = t0.id");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -37,7 +37,7 @@ public class IsEmptyExpressionQueryTest extends BaseTestCase {
|
||||
.query();
|
||||
|
||||
query.findList();
|
||||
assertThat(sqlOf(query)).contains("select t0.id from o_customer t0 where exists (select 1 from contact where customer_id = t0.id");
|
||||
assertThat(sqlOf(query)).contains("select t0.id from o_customer t0 where exists (select 1 from contact x where x.customer_id = t0.id");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -51,7 +51,7 @@ public class IsEmptyExpressionQueryTest extends BaseTestCase {
|
||||
.query();
|
||||
|
||||
query.findList();
|
||||
assertThat(sqlOf(query)).contains("select t0.id from contact t0 where not exists (select 1 from contact_note where contact_id = t0.id");
|
||||
assertThat(sqlOf(query)).contains("select t0.id from contact t0 where not exists (select 1 from contact_note x where x.contact_id = t0.id");
|
||||
}
|
||||
|
||||
@Test
|
||||
@@ -65,7 +65,7 @@ public class IsEmptyExpressionQueryTest extends BaseTestCase {
|
||||
.query();
|
||||
|
||||
query.findList();
|
||||
assertThat(sqlOf(query)).contains("select t0.id from contact t0 where exists (select 1 from contact_note where contact_id = t0.id");
|
||||
assertThat(sqlOf(query)).contains("select t0.id from contact t0 where exists (select 1 from contact_note x where x.contact_id = t0.id");
|
||||
}
|
||||
|
||||
|
||||
@@ -95,10 +95,10 @@ public class IsEmptyExpressionQueryTest extends BaseTestCase {
|
||||
|
||||
query.findList();
|
||||
if (isPostgres()) {
|
||||
assertThat(sqlOf(query)).contains("select distinct on (t0.id) t0.id from o_customer t0 join contact u1 on u1.customer_id = t0.id where not exists (select 1 from contact_note where contact_id = u1.id)");
|
||||
assertThat(sqlOf(query)).contains("select distinct on (t0.id) t0.id from o_customer t0 join contact u1 on u1.customer_id = t0.id where not exists (select 1 from contact_note x where x.contact_id = u1.id)");
|
||||
|
||||
} else {
|
||||
assertThat(sqlOf(query)).contains("select distinct t0.id from o_customer t0 join contact u1 on u1.customer_id = t0.id where not exists (select 1 from contact_note where contact_id = u1.id)");
|
||||
assertThat(sqlOf(query)).contains("select distinct t0.id from o_customer t0 join contact u1 on u1.customer_id = t0.id where not exists (select 1 from contact_note x where x.contact_id = u1.id)");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,10 +114,10 @@ public class IsEmptyExpressionQueryTest extends BaseTestCase {
|
||||
|
||||
query.findList();
|
||||
if (isPostgres()) {
|
||||
assertThat(sqlOf(query)).contains("select distinct on (t0.id) t0.id from o_customer t0 join contact u1 on u1.customer_id = t0.id where exists (select 1 from contact_note where contact_id = u1.id)");
|
||||
assertThat(sqlOf(query)).contains("select distinct on (t0.id) t0.id from o_customer t0 join contact u1 on u1.customer_id = t0.id where exists (select 1 from contact_note x where x.contact_id = u1.id)");
|
||||
|
||||
} else {
|
||||
assertThat(sqlOf(query)).contains("select distinct t0.id from o_customer t0 join contact u1 on u1.customer_id = t0.id where exists (select 1 from contact_note where contact_id = u1.id)");
|
||||
assertThat(sqlOf(query)).contains("select distinct t0.id from o_customer t0 join contact u1 on u1.customer_id = t0.id where exists (select 1 from contact_note x where x.contact_id = u1.id)");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user