/** Add the order line to the order, and set the back reference and update the order cost. */ public void addOrderLine(OrderLine orderLine) { getOrderLines().add(orderLine); orderLine.setLineNumber(getOrderLines().size()); setTotalCost(getTotalCost() + orderLine.getCost()); }