* customer and related orders. Modify an order and flush changes back
*/
public void testRead2() throws Exception {
// Create the group and set common connection
DAS das = DAS.FACTORY.createDAS(getConfig("CustomersOrdersConfig.xml"), getConnection());
// Read all customers and remember the first one
Command read = das.getCommand("all customers");
DataObject root = read.executeQuery();
Integer id = (Integer) root.get("CUSTOMER[1]/ID");
// Read the specific Customer from above and its related orders
Command custOrders = das.getCommand("customer and orders");
custOrders.setParameter(1, id);
root = custOrders.executeQuery();
// Modify the first order and flush this change back to the database
root.setString("CUSTOMER[1]/orders[1]/PRODUCT", "Defibrillator");
Integer orderId = (Integer) root.get("CUSTOMER[1]/orders[1]/ID");
das.applyChanges(root);
// Verify
Command orderByID = das.getCommand("order by id");
orderByID.setParameter(1, orderId);
assertEquals("Defibrillator", root.getString("ANORDER[1]/PRODUCT"));
}