Order order = new Order();
order.setId(entity.getId());
order.setCancelled(entity.isCancelled());
order.setDate(entity.getDate());
order.setTotal(entity.getTotal());
CustomerEntity customerEntity = entity.getCustomer();
Customer customer = CustomerResourceBean.entity2domain(customerEntity);
order.setCustomer(customer);
for (LineItemEntity item : entity.getLineItems())
{
LineItem lineItem = entity2domain(item);