Package org.apache.tuscany.das.rdb

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


        update.addParameter( "LASTNAME", SDODataTypes.STRING );
        update.addParameter( "ID", SDODataTypes.INTEGER );
        apply.addUpdateCommand( customer.getType(), update );

        //Flush changes
        apply.execute( root );

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


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

        //Flush changes
        apply.execute( root );

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

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

        //Flush changes
        apply.execute( root );

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

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

        //Flush changes
        apply.execute( root );

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

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

        //Flush changes
        apply.execute( root );

        //Verify deletes
        select = Command.FACTORY.createCommand( "Select * from CUSTOMER where ID = :ID" );
        select.setConnection( getConnection() );
        select.setParameterValue( "ID", new Integer( cust2ID ) );
View Full Code Here

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

    //Flush changes
    apply.execute(root);

    //Verify the change
    root = select.executeQuery();
    assertEquals("Pavick", getCustomerByLastName(root, "Pavick").getString("LASTNAME"));
    assertEquals("NewCustomer", getCustomerByLastName(root, "NewCustomer").getString("LASTNAME"));
View Full Code Here

    apply.setConnection(getConnection());   

    //Flush changes -- This should fail because Order Details does not have a column that
    // we can assume to be an ID
    try {
      apply.execute(root)
    } catch (RuntimeException ex) {
      assertTrue(ex.getMessage().contains("changed in the DataGraph but is not present in the Config"));
    }

  }
View Full Code Here

    apply.setConnection(getConnection());   

    //Flush changes -- This should fail because Order Details does not have a column that
    // we can assume to be an ID
    try {
      apply.execute(root)
    } catch (RuntimeException ex) {
      assertTrue(ex.getMessage().contains("changed in the DataGraph but is not present in the Config"));
    }

  }
View Full Code Here

    apply.setConnection(getConnection());   

    //Flush changes -- This should fail because Order Details does not have a column that
    // we can assume to be an ID
    try {
      apply.execute(root)
    } catch (RuntimeException ex) {
      assertTrue(ex.getMessage().contains("changed in the DataGraph but is not present in the Config"));
    }

  }
View Full Code Here

    // Create apply command
    ApplyChangesCommand apply = Command.FACTORY.createApplyChangesCommand(getConfig("cityStates.xml"));
    apply.setConnection(getConnection());

    // Flush changes
    apply.execute(root);

    select.setConnection(getConnection());
    root = select.executeQuery();
    assertEquals(numberOfCities + 1, root.getList("CITIES").size());
    assertEquals(numberOfStates + 1, root.getList("STATES").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.