c.setC_w_id(w_id);
boolean found = c.load(basicCache);
if (!found)
throw new ElementNotFoundException("W_ID=" + w_id + " C_D_ID=" + d_id + " C_ID=" + c_id + " not found!");
w.setW_id(w_id);
found = w.load(basicCache);
if (!found) throw new ElementNotFoundException("W_ID=" + w_id + " not found!");
District d = new District();
// see clause 2.4.2.2 (dot 4)
d.setD_id(d_id);
d.setD_w_id(w_id);
found = d.load(basicCache);
if (!found) throw new ElementNotFoundException("D_ID=" + d_id + " D_W_ID=" + w_id + " not found!");
o_id = d.getD_next_o_id();
NewOrder no = new NewOrder(o_id, d_id, w_id);
no.store(basicCache);
d.setD_next_o_id(d.getD_next_o_id() + 1);
d.store(basicCache);
Order o = new Order(o_id, d_id, w_id, c_id, new Date(), -1, o_ol_cnt, o_all_local);
o.store(basicCache);
// see clause 2.4.2.2 (dot 8)
for (int ol_number = 1; ol_number <= o_ol_cnt; ol_number++) {
ol_supply_w_id = supplierWarehouseIDs[ol_number - 1];
ol_i_id = itemIDs[ol_number - 1];
ol_quantity = orderQuantities[ol_number - 1];
// clause 2.4.2.2 (dot 8.1)
Item i = new Item();
i.setI_id(ol_i_id);
found = i.load(basicCache);
if (!found) throw new ElementNotFoundException("I_ID=" + ol_i_id + " not found!");
itemPrices[ol_number - 1] = i.getI_price();
itemNames[ol_number - 1] = i.getI_name();
// clause 2.4.2.2 (dot 8.2)
Stock s = new Stock();
s.setS_i_id(ol_i_id);
s.setS_w_id(ol_supply_w_id);
found = s.load(basicCache);
if (!found) throw new ElementNotFoundException("I_ID=" + ol_i_id + " not found!");
s_quantity = s.getS_quantity();
stockQuantities[ol_number - 1] = s_quantity;
// clause 2.4.2.2 (dot 8.2)