From ef7f18f30c168b1cb4b046bfde99ac23cd9ba934 Mon Sep 17 00:00:00 2001 From: Albert Lee Date: Wed, 3 Dec 2008 21:41:54 +0000 Subject: [PATCH] OPENJPA-811 - Committ on behalf of Pinaki Poddar and Dinkar Rao. git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@723088 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/openjpa/jdbc/sql/OracleDictionary.java | 4 ++++ .../org/apache/openjpa/jdbc/sql/localizer.properties | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java index 4b41ed3c2..2714a8448 100644 --- a/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java +++ b/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/OracleDictionary.java @@ -51,6 +51,7 @@ import org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement; 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 class OracleDictionary 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 diff --git a/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/sql/localizer.properties b/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/sql/localizer.properties index 01fff7654..4ad822811 100644 --- a/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/sql/localizer.properties +++ b/openjpa-jdbc/src/main/resources/org/apache/openjpa/jdbc/sql/localizer.properties @@ -184,5 +184,6 @@ long-index-name: Index name "{0}" is {1}-character long. The database allows \ long-constraint-name: Constraint name "{0}" is {1}-character long. The \ database allows maximum {2}-character for a constraint name. long-seq-name: Sequence name "{0}" is {1}-character long. The database allows \ - maximum {2}-character for a sequence name. - \ No newline at end of file + maximum {2}-character for a sequence name. +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