#900 - Error - Can't fetch JsonDB field - org.postgresql.util.PSQLException: ERROR: could not identify an equality operator for type json

This commit is contained in:
Rob Bygrave
2016-12-20 02:59:47 +13:00
parent 2eb0c12213
commit 84e1e12b66
23 changed files with 339 additions and 102 deletions
@@ -94,7 +94,12 @@ public class IsEmptyExpressionQueryTest extends BaseTestCase {
.query();
query.findList();
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)");
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)");
} 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)");
}
}
@Test
@@ -108,7 +113,12 @@ public class IsEmptyExpressionQueryTest extends BaseTestCase {
.query();
query.findList();
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)");
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)");
} 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)");
}
}
}