Package org.apache.tuscany.das.rdb

Examples of org.apache.tuscany.das.rdb.Command.executeQuery()


        insert.execute();

        // Verify
        Command select = Command.FACTORY.createCommand("Select * from CUSTOMER where ID = 10");
        select.setConnection(getConnection());
        DataObject root = select.executeQuery();
        assertEquals(1, root.getList("CUSTOMER").size());
        assertEquals("5528 Wells Fargo Dr", root.get("CUSTOMER[1]/ADDRESS"));

    }

View Full Code Here


        CommandGroup commandGroup = CommandGroup.FACTORY.createCommandGroup(getConfig("CompanyConfig.xml"));

        // Read a specific company based on the known ID
        Command readCust = commandGroup.getCommand("all companies and departments");
        DataObject root = readCust.executeQuery();
        DataObject lastCustomer = root.getDataObject("COMPANY[3]");
        Iterator i = lastCustomer.getList("departments").iterator();
        Random generator = new Random();
        int random = generator.nextInt(1000) + 1;
        DataObject department;
View Full Code Here

        // Verify
        Command select = Command.FACTORY
                .createCommand("Select * from conmgt.serverstatus where statusid = 316405209");
        select.setConnection(getConnection());
        DataObject root = select.executeQuery();
        assertEquals(1, root.getList("conmgt.serverstatus").size());

    }


View Full Code Here

        insert.execute();

        // Verify
        Command select = Command.FACTORY.createCommand("Select * from conmgt.serverstatus");
        select.setConnection(getConnection());
        DataObject root = select.executeQuery();
        assertEquals(1, root.getList("SERVERSTATUS").size());

    }

    public void testWASDefect330118() throws Exception {
View Full Code Here

        CommandGroup commandGroup = CommandGroup.FACTORY.createCommandGroup(getConfig("CustomersOrdersConfig.xml"));
        commandGroup.setConnection(getConnection());

        // Read all customers and add one
        Command read = commandGroup.getCommand("all customers");
        DataObject root = read.executeQuery();
        int numCustomers = root.getList("CUSTOMER").size();

        DataObject newCust = root.createDataObject("CUSTOMER");
        newCust.set("ID", new Integer(100));
        newCust.set("ADDRESS", "5528 Wells Fargo Drive");
View Full Code Here

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

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

    }

    /**
 
View Full Code Here

        insert.execute();

        // Verify
        Command select = Command.FACTORY.createCommand("Select * from CUSTOMER where ID = 10");
        select.setConnection(getConnection());
        DataObject root = select.executeQuery();
        assertEquals(1, root.getList("CUSTOMER").size());
        assertEquals("5528 Wells Fargo Dr", root.get("CUSTOMER[1]/ADDRESS"));

    }

View Full Code Here

        insert.setParameterValue("ADDRESS", null);
        insert.execute();

        // Verify
        Command select = commandGroup.getCommand("read customer 10");
        DataObject root = select.executeQuery();
        assertEquals(1, root.getList("CUSTOMER").size());
        assertEquals("5528 Wells Fargo Dr", root.get("CUSTOMER[1]/ADDRESS"));

    }
   
View Full Code Here

        insert.execute();

        //Verify
        Command select = Command.FACTORY.createCommand("Select * from CUSTOMER where ID = 10");
        select.setConnection(getConnection());
        DataObject root = select.executeQuery();   
        assertEquals(1, root.getList("CUSTOMER").size());
        assertEquals("5528 Wells Fargo Dr", root.get("CUSTOMER[1]/ADDRESS"));

    }
  
View Full Code Here

    {

        //Read customer 1
        Command select = Command.FACTORY.createCommand( "Select * from CUSTOMER where ID = 1" );
        select.setConnection( getConnection() );
        DataObject root = select.executeQuery();

        DataObject customer = (DataObject) root.get( "CUSTOMER[1]" );

        //Modify customer
        customer.set( "LASTNAME", "Pavick" );
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.