for (Map.Entry<String, Object> att : attributes.entrySet())
order.set(att.getKey(), att.getValue());
// customer
if (attributes.get("customer_id") != null) {
Customer customer = new Customer();
customer.setId(new Integer((String) attributes.get("customer_id")));
if (attributes.get("customer_email") != null)
customer.setEmail((String) attributes.get("customer_email"));
if (attributes.get("customer_prefix") != null)
customer.setPrefix((String) attributes.get("customer_prefix"));
if (attributes.get("customer_firstname") != null)
customer.setFirstName((String) attributes
.get("customer_firstname"));
if (attributes.get("customer_middlename") != null)
customer.setMiddleName((String) attributes
.get("customer_middlename"));
if (attributes.get("customer_lastname") != null)
customer.setLastName((String) attributes
.get("customer_lastname"));
if (attributes.get("customer_lastname") != null)
customer.setLastName((String) attributes
.get("customer_lastname"));
if (attributes.get("customer_group_id") != null)
customer.setGroupId(new Integer((String) attributes
.get("customer_group_id")));
if (attributes.get("customer_gender") != null) {
Integer gender = new Integer((String) attributes
.get("customer_gender"));
customer.setGender(gender.equals(new Integer(1)) ? Gender.MALE
: Gender.FEMALE);
}
order.setCustomer(customer);
}