mirror of https://github.com/apache/openjpa.git
Override "ON DELETE SET NULL" foreign keys if the foreign column is "NOT NULL".
git-svn-id: https://svn.apache.org/repos/asf/incubator/openjpa/trunk@449532 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
a8c1fad16c
commit
d3956a7d98
|
@ -2908,12 +2908,20 @@ public class DBDictionary
|
|||
|| !supportsUpdateAction(fk.getUpdateAction()))
|
||||
return null;
|
||||
|
||||
String delAction = getActionName(fk.getDeleteAction());
|
||||
String upAction = getActionName(fk.getUpdateAction());
|
||||
|
||||
Column[] locals = fk.getColumns();
|
||||
Column[] foreigns = fk.getPrimaryKeyColumns();
|
||||
|
||||
int delActionId = fk.getDeleteAction();
|
||||
if (delActionId == ForeignKey.ACTION_NULL) {
|
||||
for (int i = 0; i < foreigns.length; i++) {
|
||||
if (foreigns[i].isNotNull())
|
||||
delActionId = ForeignKey.ACTION_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
String delAction = getActionName(delActionId);
|
||||
String upAction = getActionName(fk.getUpdateAction());
|
||||
|
||||
StringBuffer buf = new StringBuffer();
|
||||
if (fk.getName() != null
|
||||
&& CONS_NAME_BEFORE.equals(constraintNameMode))
|
||||
|
|
Loading…
Reference in New Issue