Uploaded image for project: 'Tuscany'
  1. Tuscany
  2. TUSCANY-957

DAS generates invalid INSERT statement when no properties are set on the new DO

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • Java-SCA-M2
    • Java DAS RDB
    • 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()); }

      Attachments

        Activity

          People

            bdaniel Brent Daniel
            kwilliams Kevin Joe Williams
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: