@Override
@Transactional(readOnly = false)
public Order createOrder(Cart cart, Account customer) {
Order order = new Order(customer);
for (Entry<Book, Integer> line : cart.getBooks().entrySet()) {
order.addOrderDetail(new OrderDetail(line.getKey(), line.getValue()));
}
order.setOrderDate(new Date());
return order;
}