Package org.apache.tuscany.das.rdb

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


        // Modify the first order and flush this change back to the database
        root.setString("CUSTOMER[1]/orders[1]/PRODUCT", "Defibrillator");
        Integer orderId = (Integer) root.get("CUSTOMER[1]/orders[1]/ID");
        ApplyChangesCommand flush = commandGroup.getApplyChangesCommand();
        flush.execute(root);

        // Verify
        Command orderByID = commandGroup.getCommand("order by id");
        orderByID.setParameterValue("ID", orderId);
        assertEquals("Defibrillator", root.getString("ANORDER[1]/PRODUCT"));
View Full Code Here


        stockPurchase.set("PURCHASEPRICE", new Float(11.00));
        stockPurchase.set("PURCHASEDATE", new Date());

        ApplyChangesCommand apply = commandGroup.getApplyChangesCommand();

        apply.execute(root);



    }
View Full Code Here

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

        // Write
        apply.execute(root);

        // Verify
        root = getOrderDetails.executeQuery();
        orderDetails = root.getDataObject("ORDERDETAILS[1]");
        assertEquals(0f, orderDetails.getFloat("PRICE"), 0.01);
View Full Code Here

    //Try to flush the change
    ApplyChangesCommand apply = Command.FACTORY.createApplyChangesCommand(getConfig("BooksConfig.xml"));
    apply.setConnection(getConnection());

    try {
      apply.execute(root);
      fail("An OCCException should be thrown");
    } catch (RuntimeException ex) {
      if ( !ex.getMessage().equals("OCC Exception") )
        throw ex;
    }
View Full Code Here

    //Modify
    root.setDate("CUSTOMER[1]/LASTNAME", tbday)
   
    ApplyChangesCommand write = Command.FACTORY.createApplyChangesCommand(getConfig("CustomerConfigWithConverter.xml"));
    write.setConnection(getConnection());
    write.execute(root);
   
    //Read
    root = read.executeQuery();

    //Verify
View Full Code Here

        .createApplyChangesCommand(getConfig("basicCustomerMappingWithInvalidCUD.xml"));
    apply.setConnection(getConnection());

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

    customer.set("LASTNAME", "foobar");
    customer.set("ADDRESS", "asdfasdf");

    ApplyChangesCommand apply = Command.FACTORY.createApplyChangesCommand();
    apply.setConnection(getConnection());
    apply.execute(root);

    select = Command.FACTORY
        .createCommand("select * from CUSTOMER where ID = 720");
    select.setConnection(getConnection());
    root = select.executeQuery();
View Full Code Here

    ApplyChangesCommand apply = Command.FACTORY.createApplyChangesCommand(getConfig("1xM_mapping_no_cud.xml"));
    apply.setConnection(getConnection());   

    // Flush changes
    apply.execute(root);

  }
 
}
View Full Code Here

            // Build apply changes command
            ApplyChangesCommand apply = Command.FACTORY.createApplyChangesCommand();
            apply.setConnection(c, false);

            // Flush changes
            apply.execute(root);

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

       
        DataObject newDepartment = root.createDataObject("DEPARTMENT");
        firstCustomer.getList("departments").add(newDepartment);
       
        ApplyChangesCommand apply = commandGroup.getApplyChangesCommand();
        apply.execute(root);
       
        //verify
        root = read.executeQuery();
        firstCustomer = root.getDataObject("COMPANY[1]");
        assertEquals (deptCount + 1, firstCustomer.getList("departments").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.