mirror of https://github.com/apache/openjpa.git
OPENJPA-1387: Remove non-nullable constraint from Unique column.
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@880865 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
05c785704c
commit
69d2415b57
|
@ -260,7 +260,7 @@ public class TableJDBCSeq
|
|||
// importTable() does not import unique constraints
|
||||
Unique[] uniques = _pkColumn.getTable().getUniques();
|
||||
for (Unique u : uniques) {
|
||||
copy.importUnique(u);
|
||||
copy.importUnique(u, _conf.getDBDictionaryInstance());
|
||||
}
|
||||
// we need to reset the table name in the column with the
|
||||
// fully qualified name for matching the table name from the
|
||||
|
|
|
@ -737,7 +737,7 @@ public class Table
|
|||
/**
|
||||
* Import a constraint; column names must match columns of this table.
|
||||
*/
|
||||
public Unique importUnique(Unique unq) {
|
||||
public Unique importUnique(Unique unq, DBDictionary dict) {
|
||||
if (unq == null)
|
||||
return null;
|
||||
|
||||
|
@ -747,6 +747,10 @@ public class Table
|
|||
Column[] cols = unq.getColumns();
|
||||
for (int i = 0; i < cols.length; i++)
|
||||
copy.addColumn(getColumn(cols[i].getName()));
|
||||
if (dict != null && !dict.supportsNullUniqueConlumn) {
|
||||
for (Column col : copy.getColumns())
|
||||
col.setNotNull(true);
|
||||
}
|
||||
return copy;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue