mirror of https://github.com/apache/openjpa.git
OPENJPA-1599 - Retain em method user input property map content from modifications.
git-svn-id: https://svn.apache.org/repos/asf/openjpa/branches/2.0.x@927630 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
7382ba2f84
commit
d81cbbd8bb
|
@ -33,6 +33,7 @@ import java.lang.reflect.Method;
|
|||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.EnumSet;
|
||||
import java.util.HashMap;
|
||||
import java.util.IdentityHashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
@ -487,6 +488,7 @@ public class EntityManagerImpl
|
|||
@SuppressWarnings("unchecked")
|
||||
public <T> T find(Class<T> cls, Object oid, LockModeType mode, Map<String, Object> properties) {
|
||||
assertNotCloseInvoked();
|
||||
properties = cloneProperties(properties);
|
||||
configureCurrentCacheModes(pushFetchPlan(), properties);
|
||||
configureCurrentFetchPlan(getFetchPlan(), properties, mode, true);
|
||||
try {
|
||||
|
@ -1186,6 +1188,7 @@ public class EntityManagerImpl
|
|||
assertNotCloseInvoked();
|
||||
assertValidAttchedEntity(LOCK, entity);
|
||||
_broker.assertActiveTransaction();
|
||||
properties = cloneProperties(properties);
|
||||
configureCurrentCacheModes(pushFetchPlan(), properties);
|
||||
configureCurrentFetchPlan(getFetchPlan(), properties, mode, false);
|
||||
try {
|
||||
|
@ -1808,4 +1811,11 @@ public class EntityManagerImpl
|
|||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
private Map<String, Object> cloneProperties(Map<String, Object> properties) {
|
||||
if (properties != null) {
|
||||
properties = new HashMap<String, Object>(properties);
|
||||
}
|
||||
return properties;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue