Exemplo n.º 1
0
 public void delete() {
   for (int i = supplierOrderLineItems.size(); i > 0; i--) {
     SupplierOrderLineItem aSupplierOrderLineItem = supplierOrderLineItems.get(i - 1);
     aSupplierOrderLineItem.delete();
   }
   Supplier placeholderSupplier = supplier;
   this.supplier = null;
   placeholderSupplier.removeOrderToSupplier(this);
 }
Exemplo n.º 2
0
 public boolean addSupplierOrderLineItem(SupplierOrderLineItem aSupplierOrderLineItem) {
   boolean wasAdded = false;
   if (supplierOrderLineItems.contains(aSupplierOrderLineItem)) {
     return false;
   }
   OrderToSupplier existingOrderToSupplier = aSupplierOrderLineItem.getOrderToSupplier();
   boolean isNewOrderToSupplier =
       existingOrderToSupplier != null && !this.equals(existingOrderToSupplier);
   if (isNewOrderToSupplier) {
     aSupplierOrderLineItem.setOrderToSupplier(this);
   } else {
     supplierOrderLineItems.add(aSupplierOrderLineItem);
   }
   wasAdded = true;
   return wasAdded;
 }
Exemplo n.º 3
0
 public boolean removeSupplierOrderLineItem(SupplierOrderLineItem aSupplierOrderLineItem) {
   boolean wasRemoved = false;
   // Unable to remove aSupplierOrderLineItem, as it must always have a orderToSupplier
   if (!this.equals(aSupplierOrderLineItem.getOrderToSupplier())) {
     supplierOrderLineItems.remove(aSupplierOrderLineItem);
     wasRemoved = true;
   }
   return wasRemoved;
 }