mirror of https://github.com/apache/openjpa.git
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:
parent
d3ca8f3cc4
commit
35205c46ac
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue