Author: jleroux
Date: Tue Dec 25 09:06:51 2012
New Revision: 1425731
URL: http://svn.apache.org/viewvc?rev=1425731&view=rev
Log:
Reverts r1425716, 3 tests don't pass.
Modified:
ofbiz/trunk/framework/entity/src/org/ofbiz/entity/finder/PrimaryKeyFinder.java
Modified:
ofbiz/trunk/framework/entity/src/org/ofbiz/entity/finder/PrimaryKeyFinder.java
URL:
http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/finder/PrimaryKeyFinder.java?rev=1425731&r1=1425730&r2=1425731&view=diff
==============================================================================
---
ofbiz/trunk/framework/entity/src/org/ofbiz/entity/finder/PrimaryKeyFinder.java
(original)
+++
ofbiz/trunk/framework/entity/src/org/ofbiz/entity/finder/PrimaryKeyFinder.java
Tue Dec 25 09:06:51 2012
@@ -27,7 +27,6 @@ import javolution.util.FastMap;
import org.ofbiz.base.util.Debug;
import org.ofbiz.base.util.GeneralException;
import org.ofbiz.base.util.UtilGenerics;
-import org.ofbiz.base.util.UtilMisc;
import org.ofbiz.base.util.UtilValidate;
import org.ofbiz.base.util.collections.FlexibleMapAccessor;
import org.ofbiz.base.util.string.FlexibleStringExpander;
@@ -106,22 +105,26 @@ public class PrimaryKeyFinder extends Fi
GenericValue tempVal =
delegator.makeValue(modelEntity.getEntityName());
// try a map called "parameters", try it first so values from here
are overridden by values in the main context
- Map<String, Object> parametersObj =
UtilMisc.toMap(UtilGenerics.checkMap(context.get("parameters")));
+ Object parametersObj = context.get("parameters");
if (parametersObj != null && parametersObj instanceof Map<?, ?>) {
- // need the timeZone and locale for conversion, so add here
and remove after
- parametersObj.put("locale", context.get("locale"));
- parametersObj.put("timeZone", context.get("timeZone"));
- modelEntity.convertFieldMapInPlace(parametersObj, delegator);
- entityContext.remove("locale");
- entityContext.remove("timeZone");
- tempVal.setAllFields(parametersObj, true, null, Boolean.TRUE);
+ tempVal.setAllFields(UtilGenerics.checkMap(parametersObj),
true, null, Boolean.TRUE);
}
// just get the primary keys, and hopefully will get all of them,
if not they must be manually filled in below in the field-maps
tempVal.setAllFields(context, true, null, Boolean.TRUE);
+
entityContext.putAll(tempVal);
}
- EntityFinderUtil.expandFieldMapToContext(fieldMap, context,
entityContext);
+ EntityFinderUtil.expandFieldMapToContext(fieldMap, context,
entityContext);
+ //Debug.logInfo("PrimaryKeyFinder: entityContext=" + entityContext,
module);
+ // then convert the types...
+
+ // need the timeZone and locale for conversion, so add here and remove
after
+ entityContext.put("locale", context.get("locale"));
+ entityContext.put("timeZone", context.get("timeZone"));
+ modelEntity.convertFieldMapInPlace(entityContext, delegator);
+ entityContext.remove("locale");
+ entityContext.remove("timeZone");
// get the list of fieldsToSelect from selectFieldExpanderList
Set<String> fieldsToSelect =
EntityFinderUtil.makeFieldsToSelect(selectFieldExpanderList, context);