You are not providing any configuration to indicate the generated key.
BTW, Brent mentioned that this test case is covered by:
GeneratedId.testInsert5()
Luciano Resende wrote:
So, i was trying to create a test case for :
Insert with no changed properties to row with generated ID (you could
duplicate the test above with Company since it has a generated ID)
public void testPartialReadInsertApplyWithGeneratedID() throws
Exception {
DAS das = DAS.FACTORY.createDAS(getConnection());
// Read some customers
Command select = das.createCommand("Select * from COMPANY");
DataObject root = select.executeQuery();
//Remember count
int count = root.getList("COMPANY").size();
// Create a new customer
root.createDataObject("COMPANY");
// Build apply changes command
das.applyChanges(root);
// verify insert
root = select.executeQuery();
assertEquals(count + 1, root.getList("COMPANY").size());
}
DAS is generating the following SQL :
insert into COMPANY(ID, NAME, EOTMID) values (?, ?, ?)
And it's causing the following exception
SQL Exception: Attempt to modify an identity column 'ID'.
My understanding is that, when IDs are automaticaly generated primary
keys,
they should not be part of the INSERT statement.
Before I create a JIRA, I just want to make sure my understanding is
right..
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]