Package org.apache.tuscany.das.rdb

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


        DataObject newCustomer = root.createDataObject("CUSTOMER");
        newCustomer.setInt("ID", 9999);
        newCustomer.setString("LASTNAME", "Jones");

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

        // Verify changes
        root = select.executeQuery();
        boolean found = false;
        Iterator i = root.getList("CUSTOMER").iterator();
View Full Code Here


        // Modify customer
        customer.set("LASTNAME", "Pavick");

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

        // Verify changes
        root = select.executeQuery();
        assertEquals("Pavick", root.getString("CUSTOMER[1]/LASTNAME"));
View Full Code Here

        // Modify customer
        customer.set("LASTNAME", "Pavick");

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

        // Verify changes
        root = select.executeQuery();
        assertEquals("Pavick", root.getString("CUSTOMER[1]/LASTNAME"));
View Full Code Here

        // Modify customer
        customer.set("LASTNAME", "Pavick");

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

        // Verify the change
        root = select.executeQuery();
        assertEquals("Pavick", root.getDataObject("CUSTOMER[1]").getString("LASTNAME"));
View Full Code Here

        int deptCount = firstCustomer.getList("departments").size();

        DataObject newDepartment = root.createDataObject("DEPARTMENT");
        firstCustomer.getList("departments").add(newDepartment);

        das.applyChanges(root);

        //verify
        root = read.executeQuery();
        firstCustomer = root.getDataObject("COMPANY[1]");
        assertEquals(deptCount + 1, firstCustomer.getList("departments").size());
View Full Code Here

        // Associate the new department with the new company
        company.getList("departments").add(department);

        // Get apply command
        das.applyChanges(root);

        // Save the id
        Integer id = (Integer) company.get("ID");

        // Verify the change
View Full Code Here

        DataObject book = root.getDataObject("BOOK[1]");
        // Change a field to mark the instance 'dirty'
        book.setInt("QUANTITY", 2);

        try {
            das.applyChanges(root);
            fail("An exception should be thrown since here is no config to identify the primary key");
        } catch (RuntimeException ex) {
            // Expected
        }
    }
View Full Code Here

        // Change a field to mark the instance 'dirty'
        book.setInt("QUANTITY", 2);

        // Flush the change

        das.applyChanges(root);

        // Verify
        root = select.executeQuery();
        book = root.getDataObject("BOOK[1]");
        assertEquals(2, book.getInt("QUANTITY"));
View Full Code Here

        // Modify customer
        customer.set("LASTNAME", "Pavick");

        // Flush changes
        try {
            das.applyChanges(root);
            fail("Should fail with invalid SQL.  Provided CUD not used!!");
        } catch (RuntimeException e) {
            // Everything OK
        }
View Full Code Here

        DataObject customer = root.createDataObject("CUSTOMER");
        customer.setInt("ID", 720);
        customer.set("LASTNAME", "foobar");
        customer.set("ADDRESS", "asdfasdf");

        das.applyChanges(root);

        select = das.createCommand("select * from CUSTOMER where ID = 720");
        root = select.executeQuery();

        assertEquals(1, root.getList("CUSTOMER").size());
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.