OPENJPA-2335: Set non-default value to a foreign key contrained column

git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1447906 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Pinaki Poddar 2013-02-19 20:33:15 +00:00
parent 05b41094b8
commit 7ce7e55620
1 changed files with 2 additions and 2 deletions

View File

@ -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,