* Add a new Order to a list of Customers without defining any config information
*
* @throws Exception
*/
public void testAddNewOrder() throws Exception {
DAS das = DAS.FACTORY.createDAS(getConnection());
Command select = das.createCommand("SELECT * FROM CUSTOMER LEFT JOIN ANORDER "
+ "ON CUSTOMER.ID = ANORDER.CUSTOMER_ID");
DataObject root = select.executeQuery();
DataObject cust = root.getDataObject("CUSTOMER[1]");
// Save ID and Order Count
int custID = cust.getInt("ID");
int custOrderCount = cust.getList("ANORDER").size();
// Create a new Order and add to customer1
DataObject order = root.createDataObject("ANORDER");
order.set("ID", Integer.valueOf(99));
order.set("PRODUCT", "The 99th product");
order.set("QUANTITY", Integer.valueOf(99));
cust.getList("ANORDER").add(order);
assertEquals(custOrderCount + 1, cust.getList("ANORDER").size());
// Build apply changes command
das.applyChanges(root);
// verify cust1 relationship updates
select = das.createCommand("SELECT * FROM CUSTOMER LEFT JOIN ANORDER ON CUSTOMER.ID = ANORDER.CUSTOMER_ID "
+ "where CUSTOMER.ID = ?");
select.setParameter(1, Integer.valueOf(custID));
root = select.executeQuery();