Package org.apache.tuscany.das.rdb

Examples of org.apache.tuscany.das.rdb.DAS.applyChanges()


        DataObject newCustomer = root.createDataObject("CUSTOMER");
        newCustomer.set("LASTNAME", "NewCustomer");
        newCustomer.setInt("ID", 9000);

        // Build apply changes command
        das.applyChanges(root);

        // Verify the change
        root = select.executeQuery();
        assertEquals("Pavick", getCustomerByLastName(root, "Pavick").getString("LASTNAME"));
        assertEquals("NewCustomer", getCustomerByLastName(root, "NewCustomer").getString("LASTNAME"));
View Full Code Here


        // Flush changes -- This should fail because Order Details does not have
        // a column that
        // we can assume to be an ID
        try {
            das.applyChanges(root);
        } catch (RuntimeException ex) {
            assertTrue(ex.getMessage().contains("changed in the DataGraph but is not present in the Config"));
        }

    }
View Full Code Here

        // Flush changes -- This should fail because Order Details does not have
        // a column that
        // we can assume to be an ID
        try {
            das.applyChanges(root);
        } catch (RuntimeException ex) {
            assertTrue(ex.getMessage().contains("changed in the DataGraph but is not present in the Config"));
        }

    }
View Full Code Here

        // Flush changes -- This should fail because Order Details does not have
        // a column that
        // we can assume to be an ID
        try {
            das.applyChanges(root);
        } catch (RuntimeException ex) {
            assertTrue(ex.getMessage().contains("changed in the DataGraph but is not present in the Config"));
        }

    }
View Full Code Here

        georgia.setInt("ID", 4);
        georgia.setString("NAME", "GA");

        georgia.getList("cities").add(atlanta);

        das.applyChanges(root);

        root = select.executeQuery();
        assertEquals(numberOfCities + 1, root.getList("CITIES").size());
        assertEquals(numberOfStates + 1, root.getList("STATES").size());
    }
View Full Code Here

            cityNames.add(firstCity.getString("NAME"));
            firstCity.delete();
        }
        firstState.delete();

        das.applyChanges(root);

        root = select.executeQuery();

        Iterator iter = root.getList("STATES").iterator();
        while (iter.hasNext()) {
View Full Code Here

        Command update = das.createCommand("update CUSTOMER set LASTNAME = 'modified' where ID = 1");
        update.execute();

        customer.setString("ADDRESS", "main street");

        das.applyChanges(root);

        root = readCustomers.executeQuery();

        // If partial update was not used, LASTNAME would not be 'modified'
        customer = root.getDataObject("CUSTOMER[1]");
View Full Code Here

        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
View Full Code Here

        // Modify an order
        AnOrder order = (AnOrder) customer.getOrders().get(0);
        order.setProduct("Kitchen Sink 001");

        // Flush changes
        das.applyChanges((DataObject) root);

    }

}
View Full Code Here

        cust.getList("ANORDER").add(order);

        assertEquals(custOrderCount + 1, cust.getList("ANORDER").size());

        // Build apply changes command
        das.applyChanges(root);

        // verify cust1 relationship updates
        select = das.createCommand("SELECT * FROM CUSTOMER LEFT JOIN ANORDER ON CUSTOMER.ID = ANORDER.CUSTOMER_ID "
                 + "where CUSTOMER.ID = ?");

View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.