Package org.apache.tuscany.das.rdb

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


        // Create a new company
        root.createDataObject("COMPANY");

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

        // verify insert
        root = select.executeQuery();
        assertEquals(count + 1, root.getList("COMPANY").size());
View Full Code Here


        // Create a new company
        DataObject company = root.createDataObject("COMPANY");
        company.setString("NAME", "New company name");
       
        // Build apply changes command
        das.applyChanges(root);

        // verify insert
        root = select.executeQuery();
        assertEquals(count + 1, root.getList("COMPANY").size());
    }
View Full Code Here

        DataObject newCust = root.createDataObject("CUSTOMER");
        newCust.set("ID", new Integer(200));
        // 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 = 200");
        root = readNewCust.executeQuery();

        // If partial insert was not used, LASTNAME would not be
View Full Code Here

        DataObject newCust = root.createDataObject("CUSTOMER");
        newCust.set("ID", new Integer(300));
        newCust.set("ADDRESS", "5528 Wells Fargo Drive");
        newCust.set("LASTNAME", "Gerkin" );

        das.applyChanges(root);

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

        newCust = root.getDataObject("CUSTOMER[1]");
View Full Code Here

        newCust.set("ID", new Integer(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

        // 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

        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

        DataObject newBook = root.createDataObject("Book");
        newBook.setString("NAME", "Ant Colonies of the Old World");
        newBook.setInt("BOOK_ID", 1001);
        root.getList("Book").add(newBook);

        das.applyChanges(root);

        //Verify
        select.setParameter(1, new Integer(1001));
        root = select.executeQuery();
        assertEquals("Ant Colonies of the Old World", root.getString("Book[1]/NAME"));
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.