Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
Description
If a new DO is created but no properties are set then the DAS generates an invalid INSERT statement that looks something like this:
"insert into COMPANY( values ("
The following test case (added to /das/src/test/java/org/apache/tuscany/das/rdb/test/GeneratedId.java) illustrates this bug:
/**
- Test insert into row with generated ID and no attributes set
*/
public void testInsert5() throws Exception { DAS das = DAS.FACTORY.createDAS(getConfig("CompanyConfig.xml"), getConnection()); Command select = das.getCommand("all companies"); DataObject root = select.executeQuery(); root.createDataObject("COMPANY"); das.applyChanges(root); // Verify insert root = select.executeQuery(); assertEquals(4, root.getList("COMPANY").size()); }