You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openjpa.apache.org by al...@apache.org on 2008/12/03 22:41:51 UTC

svn commit: r723087 - in /openjpa/branches/1.2.x/openjpa-jdbc/src/main: java/org/apache/openjpa/jdbc/sql/OracleDictionary.java resources/org/apache/openjpa/jdbc/sql/localizer.properties

Author: allee8285
Date: Wed Dec  3 13:41:50 2008
New Revision: 723087

URL: http://svn.apache.org/viewvc?rev=723087&view=rev
Log:
OPENJPA-811 - Committ on behalf of Pinaki Poddar and Dinkar Rao.

Modified:
    openjpa/branches/1.2.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java
    openjpa/branches/1.2.x/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/sql/localizer.properties

Modified: openjpa/branches/1.2.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java
URL: http://svn.apache.org/viewvc/openjpa/branches/1.2.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java?rev=723087&r1=723086&r2=723087&view=diff
==============================================================================
--- openjpa/branches/1.2.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java (original)
+++ openjpa/branches/1.2.x/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java Wed Dec  3 13:41:50 2008
@@ -51,6 +51,7 @@
 import org.apache.openjpa.lib.util.J2DoPrivHelper;
 import org.apache.openjpa.lib.util.Localizer;
 import org.apache.openjpa.util.StoreException;
+import org.apache.openjpa.util.UserException;
 
 import serp.util.Numbers;
 
@@ -501,6 +502,9 @@
     public void setNull(PreparedStatement stmnt, int idx, int colType,
         Column col)
         throws SQLException {
+        if ((colType == Types.CLOB || colType == Types.BLOB) && col.isNotNull())
+            throw new UserException(_loc.get("null-blob-in-not-nullable", col
+                .getFullName()));
         if (colType == Types.BLOB && _driverBehavior == BEHAVE_ORACLE)
             stmnt.setBlob(idx, getEmptyBlob());
         else if (colType == Types.CLOB && _driverBehavior == BEHAVE_ORACLE

Modified: openjpa/branches/1.2.x/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/sql/localizer.properties
URL: http://svn.apache.org/viewvc/openjpa/branches/1.2.x/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/sql/localizer.properties?rev=723087&r1=723086&r2=723087&view=diff
==============================================================================
--- openjpa/branches/1.2.x/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/sql/localizer.properties (original)
+++ openjpa/branches/1.2.x/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/sql/localizer.properties Wed Dec  3 13:41:50 2008
@@ -175,3 +175,5 @@
 batch-update-success-count: ExecuteBatch command returns update success count {0}
 connection-defaults: Initial connection autoCommit: {0}, holdability: {1}, \
     TransactionIsolation: {2}
+null-blob-in-not-nullable: Can not set null value on column "{0}" \
+	because the corresponding field is set to be non-nullable.
\ No newline at end of file