assertEquals("modified", customer.getString("LASTNAME"));
assertEquals("main street", customer.getString("ADDRESS"));
}
public void testPartialInsert() throws SQLException {
DAS das = DAS.FACTORY.createDAS(getConnection());
Command readCustomers = das.createCommand("select * from CUSTOMER where ID = 1");
// Read
DataObject root = readCustomers.executeQuery();
// Create a new customer
DataObject newCust = root.createDataObject("CUSTOMER");
newCust.set("ID", Integer.valueOf(100));
newCust.set("ADDRESS", "5528 Wells Fargo Drive");
// Purposely do not set lastname to let it default to 'Garfugengheist'
// newCust.set("LASTNAME", "Gerkin" );
das.applyChanges(root);
Command readNewCust = das.createCommand("select * from CUSTOMER where ID = 100");
root = readNewCust.executeQuery();
// If partial insert was not used, LASTNAME would not be
// 'Garfugengheist'
newCust = root.getDataObject("CUSTOMER[1]");