Timestamp time = new Timestamp(new Date().getTime());
Order order = new Order(DatabaseORM.findAccount(em, curUser), time, time, 0);
for (int i = 0; i < shoppingcart.size(); i++) {
ShoppingcartItem item = shoppingcart.get(i);
order.addItem(new OrderItem(order, Integer.valueOf(item.getPhoto()), item.getProduct(), item.getColor(), item.getAmount(), DatabaseKoppeling.getItemPrice(item.getPhoto(), item.getProduct())));
}
DatabaseORM.insertOrder(em, order);
DatabaseORM.removeShoppingcart(em, shoppingcart);
}