#1743 - When using @PrimaryKeyJoinColumn, FK constraint generation cannot be disabled

This commit is contained in:
rob bygrave
2019-07-01 00:07:14 +12:00
parent d49a7c415f
commit 9f19ed5376
5 changed files with 34 additions and 17 deletions
@@ -33,11 +33,17 @@ public final class TableJoin {
*/
private final int queryHash;
private final PropertyForeignKey foreignKey;
public TableJoin(DeployTableJoin deploy) {
this(deploy, null);
}
/**
* Create a TableJoin.
*/
public TableJoin(DeployTableJoin deploy) {
public TableJoin(DeployTableJoin deploy, PropertyForeignKey foreignKey) {
this.foreignKey = foreignKey;
this.table = InternString.intern(deploy.getTable());
this.type = deploy.getType();
this.inheritInfo = deploy.getInheritInfo();
@@ -52,6 +58,7 @@ public final class TableJoin {
}
private TableJoin(TableJoin source, String overrideColumn) {
this.foreignKey = null;
this.table = source.table;
this.type = source.type;
this.inheritInfo = source.inheritInfo;
@@ -96,14 +103,6 @@ public final class TableJoin {
return true;
}
/**
* Return a hash value for adding to a query plan.
*/
public int queryHash() {
return queryHash;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder(30);
@@ -114,6 +113,13 @@ public final class TableJoin {
return sb.toString();
}
/**
* Return the foreign key options.
*/
public PropertyForeignKey getForeignKey() {
return foreignKey;
}
/**
* Return the join columns.
*/