addReadWriteAccess(Order.class);
addReadWriteAccess(OrderLine.class);
final OBCriteria<Order> orders = OBDal.getInstance().createCriteria(Order.class);
orders.add(Expression.eq(Order.PROPERTY_DOCUMENTSTATUS, "DR"));
OrderLine toRemove = null;
for (final Order o : orders.list()) {
log.debug("Order: " + o.get(Order.PROPERTY_DOCUMENTNO) + " - no. lines: "
+ o.getOrderLineList().size());
for (OrderLine ol : o.getOrderLineList()) {
if (lineId.equals(ol.getId())) {