Package org.apache.tuscany.das.rdb

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


        bob.setInt("MANAGER", 0);

        bob.setDataObject("company", company);

        try {
            das.applyChanges(root);
            fail("Relationship modification should not be allowed.");
        } catch (RuntimeException ex) {
            assertEquals("Can not modify a one to one relationship that is key restricted", ex.getMessage());
        }
        assertEquals("ACME Publishing", company.getString("NAME"));
View Full Code Here


        assertEquals(kbday, root.getDate("CUSTOMER[1]/LASTNAME"));

        // Modify
        root.setDate("CUSTOMER[1]/LASTNAME", tbday);

        das.applyChanges(root);

        // Read
        root = read.executeQuery();

        // Verify
View Full Code Here

        customer.setAddress("an address");

        customer.getOrders().add(order);

        try {
            das.applyChanges(root);
        } catch (Exception ex) {
            assertEquals("java.lang.ClassNotFoundException: not.a.valid.class", ex.getMessage());
        }

    }
View Full Code Here

        DataObject company = root.createDataObject("COMPANY");
        company.setString("NAME", "Phil's Tires");
        // This shouldn't do anything
        company.setInt("ID", 999);

        das.applyChanges(root);

        // Verify insert                
        root = select.executeQuery();

        assertEquals(4, root.getList("COMPANY").size());
View Full Code Here

        // verify pre-condition (id is not there until after flush)
        assertNull(company.get("ID"));

        // Flush changes     
        das.applyChanges(root);

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

        // Verify the change
View Full Code Here

        // verify pre-condition (id is not there until after flush)
        assertNull(company.get("ID"));

        // Flush changes     
        das.applyChanges(root);

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

        // Verify the change
View Full Code Here

        department.setString("DEPNUMBER", "101");

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

        das.applyChanges(root);

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

        // Verify the change
View Full Code Here

        department.setString("DEPNUMBER", "101");

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

        das.applyChanges(root);

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

        // Verify the change
View Full Code Here

        c.setID(4000);
        c.setLastName("Smith");
        c.setAddress("400 Fourth Street");

        DAS das = DAS.FACTORY.createDAS(helper.getConfig(), getConnection());
        das.applyChanges(graph);

        Command cmd = das.createCommand("select * from CUSTOMER order by ID desc");
        graph = cmd.executeQuery();
        assertEquals(6, graph.getList("Customer").size());
        assertEquals("Smith", graph.getDataObject("Customer[1]").getString("lastName"));
View Full Code Here

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

        // Build apply changes command
        try {
            das.applyChanges(root);
            fail("An OCCException should be thrown");
        } catch (OptimisticConcurrencyException ex) {
            if (!ex.getMessage().equals("An update collision occurred")) {
                throw ex;
            }
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.