openjpa-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ppod...@apache.org
Subject svn commit: r1447906 - /openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/PrimaryRow.java
Date Tue, 19 Feb 2013 20:33:16 GMT
Author: ppoddar
Date: Tue Feb 19 20:33:15 2013
New Revision: 1447906

URL: http://svn.apache.org/r1447906
Log:
OPENJPA-2335: Set non-default value to a foreign key contrained column

Modified:
    openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/PrimaryRow.java

Modified: openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/PrimaryRow.java
URL: http://svn.apache.org/viewvc/openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/PrimaryRow.java?rev=1447906&r1=1447905&r2=1447906&view=diff
==============================================================================
--- openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/PrimaryRow.java (original)
+++ openjpa/trunk/openjpa-jdbc/src/main/java/org/apache/openjpa/jdbc/sql/PrimaryRow.java Tue
Feb 19 20:33:15 2013
@@ -338,9 +338,9 @@ public class PrimaryRow
             if (prev == NULL)
                 prev = null;
             if (!rowValueEquals(prev, val)) {
-            	if (allowsUpdate(col, prev, val)) {
+            	if (isDefaultValue(prev) || allowsUpdate(col, prev, val)) {
             		super.setObject(col, val, metaType, overrideDefault);
-            	} else if (!isDefaultValue(val)) {
+            	} else if (!isDefaultValue(prev)) {
             		throw new InvalidStateException(_loc.get("diff-values",
             				new Object[]{ col.getFullDBIdentifier().getName(),
                             (prev == null) ? null : prev.getClass(), prev,



Mime
View raw message