#1228 - Add support to not generate FK Constraint when @JoinColumn(foreignKey=@ForeignKey(ConstraintMode.NO_CONSTRAINT))

This commit is contained in:
Rob Bygrave
2018-02-19 22:45:47 +13:00
parent 183d079b58
commit 2be3099d55
4 changed files with 91 additions and 0 deletions
@@ -10,6 +10,19 @@ public class PropertyForeignKey {
private final ConstraintMode onDelete;
private final ConstraintMode onUpdate;
/**
* Construct for "No Constraint".
*/
public PropertyForeignKey() {
this.noConstraint = true;
this.noIndex = false;
this.onDelete = ConstraintMode.GLOBAL_DEFAULT;
this.onUpdate = ConstraintMode.GLOBAL_DEFAULT;
}
/**
* Construct for the mapping annotation.
*/
public PropertyForeignKey(DbForeignKey dbForeignKey) {
this.noIndex = dbForeignKey.noIndex();
this.noConstraint = dbForeignKey.noConstraint();