public Order createOrder(final Customer customer, final CreditCard creditCard, final List<CartItem> cartItems) {
// OMake sure the object is valid
if (cartItems == null || cartItems.size() == 0)
throw new ValidationException("Shopping cart is empty"); // TODO exception bean validation
// Creating the order
Order order = new Order(em.merge(customer), creditCard, customer.getHomeAddress());
// From the shopping cart we create the order lines