#323 - DDL Generation support for foreign key cascade options

This commit is contained in:
Rob Bygrave
2018-02-19 22:24:37 +13:00
parent b8aa822a30
commit 40634412f5
31 changed files with 868 additions and 133 deletions
@@ -35,7 +35,7 @@ public class TestOneToOnePrimaryKeyJoin extends BaseTestCase {
OtoPrime found = query.findOne();
assertThat(found).isNotNull();
assertThat(sqlOf(query)).contains("select t0.pid, t0.name, t0.version, t0.pid from oto_prime t0 where t0.pid = ?")
assertThat(sqlOf(query, 10)).contains("select t0.pid, t0.name, t0.version, t0.pid from oto_prime t0 where t0.pid = ?")
.as("we don't join to oto_prime_extra");
assertThat(found.getName()).isEqualTo("p" + desc);
@@ -47,7 +47,7 @@ public class TestOneToOnePrimaryKeyJoin extends BaseTestCase {
OtoPrime oneWith = queryWithFetch.findOne();
assertThat(oneWith).isNotNull();
assertThat(sqlOf(queryWithFetch)).contains("select t0.pid, t0.name, t0.version, t1.eid, t1.extra, t1.version from oto_prime t0 join oto_prime_extra t1 on t1.eid = t0.pid where t0.pid = ?")
assertThat(sqlOf(queryWithFetch, 10)).contains("select t0.pid, t0.name, t0.version, t1.eid, t1.extra, t1.version from oto_prime t0 join oto_prime_extra t1 on t1.eid = t0.pid where t0.pid = ?")
.as("we join to oto_prime_extra");