Fixed issue with deserialization from XML of an entity value with null fields

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1458429 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
David E. Jones
2013-03-19 17:48:28 +00:00
parent 90d8cfb75d
commit 1c6adf2f0a
@@ -2377,7 +2377,13 @@ public class GenericDelegator implements Delegator {
String attr = element.getAttribute(name);
if (UtilValidate.isNotEmpty(attr)) {
value.setString(name, attr);
// GenericEntity.makeXmlElement() sets null values to GenericEntity.NULL_FIELD.toString(), so look for
// that and treat it as null
if (GenericEntity.NULL_FIELD.toString().equals(attr)) {
value.set(name, null);
} else {
value.setString(name, attr);
}
} else {
// if no attribute try a subelement
Element subElement = UtilXml.firstChildElement(element, name);