Package org.apache.tuscany.das.rdb

Examples of org.apache.tuscany.das.rdb.ApplyChangesCommand.execute()


        // Get apply command
        ApplyChangesCommand apply = commandGroup.getApplyChangesCommand();
        apply.setConnection(getConnection());

        // Flush changes
        apply.execute(root);

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

        // Verify the change
View Full Code Here


        // Flush the change
        ApplyChangesCommand apply = Command.FACTORY.createApplyChangesCommand();
        apply.setConnection(getConnection());

        try {
            apply.execute(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

        helper.addPrimaryKey("BOOK.BOOK_ID");

        ApplyChangesCommand apply = Command.FACTORY.createApplyChangesCommand(helper.getConfig());
        apply.setConnection(getConnection());

        apply.execute(root);

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

        newBook.setInt("BOOK_ID", 1001);
        root.getList("Book").add(newBook);
              
        ApplyChangesCommand apply = Command.FACTORY.createApplyChangesCommand(helper.getConfig());
        apply.setConnection(getConnection());
        apply.execute(root);
       
        //Verify
        select.setParameterValue("ID", new Integer(1001));
        root = select.executeQuery();
        assertEquals("Ant Colonies of the Old World", root.getString("Book[1]/NAME"));
View Full Code Here

            customer.set("email", customerProfile.getEmail());
            customer.set("loginID", customerProfile.getLoginID());
            customer.set("password", customerProfile.getPassword());

            ApplyChangesCommand apply = commandGroup.getApplyChangesCommand();
            apply.execute(root);
            return getCustomerProfile(customerProfile.getLoginID());

        } catch (Exception e) {
            if (e instanceof RemoteException)
                throw (RemoteException) e;
View Full Code Here

        // Build apply changes command
        ApplyChangesCommand apply = Command.FACTORY.createApplyChangesCommand(getConfig("CustomersOrdersConfig.xml"));
        apply.setConnection(getConnection());

        // Flush changes
        apply.execute(root);

        // verify cust1 relationship updates
        select = Command.FACTORY
                .createCommand("SELECT * FROM CUSTOMER LEFT JOIN ANORDER ON CUSTOMER.ID = ANORDER.CUSTOMER_ID where CUSTOMER.ID = :ID",getConfig("CustomersOrdersConfig.xml"));
        select.setConnection(getConnection());
View Full Code Here

        // Now delete this new customer
        newCust.delete();

        ApplyChangesCommand apply = commandGroup.getApplyChangesCommand();
        apply.execute(root);

        // Verify
        root = read.executeQuery();
        assertEquals(numCustomers, root.getList("CUSTOMER").size());
View Full Code Here

            department.setString("NAME", "Dept-" + random);
            random = random + 1;
        }

        ApplyChangesCommand apply = commandGroup.getApplyChangesCommand();
        apply.execute(root);

    }

}
View Full Code Here

        // Now delete this new customer
        newCust.delete();

        ApplyChangesCommand apply = commandGroup.getApplyChangesCommand();
        apply.execute(root);

        // Verify
        root = read.executeQuery();
        assertEquals(numCustomers, root.getList("CUSTOMER").size());
View Full Code Here

            department.setString("NAME", "Dept-" + random);
            random = random + 1;
        }
       
        ApplyChangesCommand apply = commandGroup.getApplyChangesCommand();
        apply.execute(root);
       
   
        
   
   
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.