#1743 - Add hasForeignKeyConstraint()

Separate hasForeignKeyConstraint() for DDL use from hasForeignKey() used in query
This commit is contained in:
rob bygrave
2019-07-01 21:04:40 +12:00
parent 9f19ed5376
commit 7f2e4f54ff
4 changed files with 18 additions and 10 deletions
@@ -49,8 +49,7 @@ class ModelBuildIntersectionTable {
private void buildFkConstraints() {
PropertyForeignKey foreignKey = manyProp.getForeignKey();
if (foreignKey == null || !foreignKey.isNoConstraint()) {
if (manyProp.hasForeignKeyConstraint()) {
ctx.fkeyBuilder(intersectionTable)
.addForeignKey(manyProp.getBeanDescriptor(), intersectionTableJoin, true)
.addForeignKey(manyProp.getTargetDescriptor(), tableJoin, false);