#323 - DDL Generation support for foreign key cascade options

This commit is contained in:
Rob Bygrave committed 2018-02-19 22:24:37 +13:00
1 parent b8aa822a30
commit 40634412f5
31 files changed
+868 -133

No files matched your search

@@ -41,6 +41,8 @@ public class BeanPropertyAssocOne<T> extends BeanPropertyAssoc<T> {
private final boolean primaryKeyExport;
private final PropertyForeignKey foreignKey;
private AssocOneHelp localHelp;
protected final BeanProperty[] embeddedProps;
@@ -69,6 +71,7 @@ public class BeanPropertyAssocOne<T> extends BeanPropertyAssoc<T> {
super(descriptor, deploy);
foreignKey = deploy.getForeignKey();
primaryKeyExport = deploy.isPrimaryKeyExport();
importedPrimaryKey = deploy.isImportedPrimaryKey();
oneToOne = deploy.isOneToOne();
@@ -309,6 +312,18 @@ public class BeanPropertyAssocOne<T> extends BeanPropertyAssoc<T> {
}
}
public PropertyForeignKey getForeignKey() {
return foreignKey;
}
public boolean hasForeignKey() {
return foreignKey == null || !foreignKey.isNoConstraint();
}
public boolean hasForeignKeyIndex() {
return foreignKey == null || !foreignKey.isNoIndex();
}
/**
* Return true if this a OneToOne property. Otherwise assumed ManyToOne.
*/