OPENJPA-1784: clean up fix

git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@995596 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Fay Wang 2010-09-09 22:35:19 +00:00
parent d3ca8f3cc4
commit 35205c46ac
2 changed files with 6 additions and 9 deletions

View File

@ -21,7 +21,6 @@ package org.apache.openjpa.jdbc.meta.strats;
import java.sql.*;
import java.util.*;
import org.apache.openjpa.enhance.PersistenceCapable;
import org.apache.openjpa.jdbc.identifier.DBIdentifier;
import org.apache.openjpa.jdbc.kernel.*;
import org.apache.openjpa.jdbc.meta.*;
@ -215,11 +214,8 @@ public class HandlerHandlerMapTableFieldStrategy
for (Iterator itr = change.iterator(); itr.hasNext();) {
mkey = itr.next();
Object mval = map.get(mkey);
if ((mval instanceof PersistenceCapable) && !((PersistenceCapable)mval).pcIsDirty())
continue;
HandlerStrategies.where(key, mkey, store, changeRow, _kcols);
HandlerStrategies.set(val, mval, store, changeRow,
HandlerStrategies.set(val, map.get(mkey), store, changeRow,
_vcols, _vio, true);
rm.flushSecondaryRow(changeRow);
}

View File

@ -26,8 +26,6 @@ import java.util.Map;
import java.util.Iterator;
import java.util.Set;
import org.apache.openjpa.enhance.PersistenceCapable;
/**
* Utility methods used by map proxies.
*
@ -85,6 +83,9 @@ public class ProxyMaps
/**
* Call after invoking {@link Map#get} on super.
* The potential change is tracked when the get method is called. This change
* will not translated to an update statement if the retrieved value
* is not dirty.
*
* @param ret the return value from the super's method
* @param before the return value from {@link #beforeGet}
@ -93,10 +94,10 @@ public class ProxyMaps
public static Object afterGet(ProxyMap map, Object key,
Object ret, boolean before) {
if (before) {
if (map.getChangeTracker() != null && (ret instanceof PersistenceCapable))
if (map.getChangeTracker() != null)
((MapChangeTracker) map.getChangeTracker()).changed(key, ret,
ret);
}
}
return ret;
}