Package org.apache.tuscany.das.rdb

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


    //Create and initialize command to read customers
    Command readCustomers = Command.FACTORY.createCommand("select * from CUSTOMER where ID = 1")
    readCustomers.setConnection(getConnection());

    //Read
    DataObject root = readCustomers.executeQuery();
   
    DataObject cust = root.getDataObject("CUSTOMER[1]");
   
//    int n = (cust.getType().getProperties()).size();
//    for (int i=0; i<n; i++) {
View Full Code Here


    //Create and initialize command to read customers
    Command readCustomers = Command.FACTORY.createCommand("   select * from CUSTOMER where ID = 1")
    readCustomers.setConnection(getConnection());

    //Read
    DataObject root = readCustomers.executeQuery();
   
    //Verify
    assertEquals(1, root.getInt("CUSTOMER[1]/ID"));
  }
 
View Full Code Here

    //Create and initialize command to read customers
    Command readCustomers = Command.FACTORY.createCommand("select * from CUSTOMER where LASTNAME = 'Williams'")
    readCustomers.setConnection(getConnection());

    //Read
    DataObject root = readCustomers.executeQuery();
   
    //Verify
    assertEquals(4, root.getList("CUSTOMER").size());
  }
 
View Full Code Here

    Command readCustomers = Command.FACTORY.createCommand("select * from CUSTOMER where LASTNAME = :LASTNAME")
    readCustomers.setConnection(getConnection());

    //Parameterize the command
    readCustomers.setParameterValue("LASTNAME", "Williams");
    DataObject root = readCustomers.executeQuery();
   
    //Verify
    assertEquals(4, 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

   
    Command select = Command.FACTORY
        .createCommand("Select ID, LASTNAME, ADDRESS from CUSTOMER where ID <= :ID");
    select.setConnection(getConnection());
    select.setParameterValue("ID", "3");
    DataObject graph1 = select.executeQuery();
    assertEquals(3, graph1.getList("CUSTOMER").size());

    select.setParameterValue("ID", "5");
    DataObject graph2 = select.executeQuery();
    assertEquals(5, graph2.getList("CUSTOMER").size());
View Full Code Here

    select.setParameterValue("ID", "3");
    DataObject graph1 = select.executeQuery();
    assertEquals(3, graph1.getList("CUSTOMER").size());

    select.setParameterValue("ID", "5");
    DataObject graph2 = select.executeQuery();
    assertEquals(5, graph2.getList("CUSTOMER").size());

    GraphMerger merger = new GraphMerger();
    merger.addPrimaryKey("CUSTOMER.ID");
    DataObject mergedGraph = merger.merge(graph1, graph2);
View Full Code Here

    Command select = Command.FACTORY
        .createCommand("Select ID, LASTNAME, ADDRESS from CUSTOMER where ID <= :ID");
    select.setConnection(getConnection());
    select.setParameterValue("ID", "3");
    DataObject graph1 = select.executeQuery();
    assertEquals(3, graph1.getList("CUSTOMER").size());

    select.setParameterValue("ID", "4");
    DataObject graph2 = select.executeQuery();
    assertEquals(4, graph2.getList("CUSTOMER").size());
View Full Code Here

    select.setParameterValue("ID", "3");
    DataObject graph1 = select.executeQuery();
    assertEquals(3, graph1.getList("CUSTOMER").size());

    select.setParameterValue("ID", "4");
    DataObject graph2 = select.executeQuery();
    assertEquals(4, graph2.getList("CUSTOMER").size());

    select.setParameterValue("ID", "5");
    DataObject graph3 = select.executeQuery();
    assertEquals(5, graph3.getList("CUSTOMER").size());
View Full Code Here

    select.setParameterValue("ID", "4");
    DataObject graph2 = select.executeQuery();
    assertEquals(4, graph2.getList("CUSTOMER").size());

    select.setParameterValue("ID", "5");
    DataObject graph3 = select.executeQuery();
    assertEquals(5, graph3.getList("CUSTOMER").size());

    GraphMerger merger = new GraphMerger();
    merger.addPrimaryKey("CUSTOMER.ID");
    ArrayList graphs = new ArrayList();
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.