if (attributes.get("items") != null) {
List<Map<String, Object>> res = (List<Map<String, Object>>) attributes
.get("items");
for (Map<String, Object> i : res) {
OrderItem item = new OrderItem();
for (Map.Entry<String, Object> att : i.entrySet())
item.set(att.getKey(), att.getValue());
order.getItems().add(item);
}
}