openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ppod...@apache.org
Subject svn commit: r880865 - in /openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc: kernel/TableJDBCSeq.java schema/Table.java
Date Mon, 16 Nov 2009 17:32:21 GMT
Author: ppoddar
Date: Mon Nov 16 17:32:21 2009
New Revision: 880865

URL: http://svn.apache.org/viewvc?rev=880865&view=rev
Log:
OPENJPA-1387: Remove non-nullable constraint from Unique column.

Modified:
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/TableJDBCSeq.java
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/Table.java

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/TableJDBCSeq.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/TableJDBCSeq.java?rev=880865&r1=880864&r2=880865&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/TableJDBCSeq.java
(original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/kernel/TableJDBCSeq.java
Mon Nov 16 17:32:21 2009
@@ -260,7 +260,7 @@
             // 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

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/Table.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/Table.java?rev=880865&r1=880864&r2=880865&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/Table.java (original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/schema/Table.java Mon
Nov 16 17:32:21 2009
@@ -737,7 +737,7 @@
     /**
      * 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 @@
         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;
     }
 



Mime
View raw message