return typeMap;
}
private <T> void setStructuralTypeValuesFromMap(final T data, final EdmStructuralType type,
final Map<String, Object> valueMap, final boolean merge) throws ODataException {
ODataContext context = getContext();
final int timingHandle =
context.startRuntimeMeasurement(getClass().getSimpleName(), "setStructuralTypeValuesFromMap");
for (final String propertyName : type.getPropertyNames()) {
final EdmProperty property = (EdmProperty) type.getProperty(propertyName);
if (type instanceof EdmEntityType && ((EdmEntityType) type).getKeyProperties().contains(property)) {
Object v = valueAccess.getPropertyValue(data, property);
if (v != null) {
continue;
}
}
if (!merge || valueMap != null && valueMap.containsKey(propertyName)) {
final Object value = valueMap == null ? null : valueMap.get(propertyName);
if (property.isSimple()) {
valueAccess.setPropertyValue(data, property, value);
} else {
@SuppressWarnings("unchecked")
final Map<String, Object> values = (Map<String, Object>) value;
setStructuralTypeValuesFromMap(valueAccess.getPropertyValue(data, property),
(EdmStructuralType) property.getType(), values, merge);
}
}
}
context.stopRuntimeMeasurement(timingHandle);
}