Package org.apache.tuscany.das.rdb

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


        DataObject root = select.executeQuery();
        assertEquals(1, root.getList("CUSTOMER").size());

        // Create and execute the delete command
        Command delete = das.createCommand("delete from CUSTOMER where ID = 1");
        delete.execute();

        // Verify delete by reusing the original select command
        root = select.executeQuery();
        assertEquals(0, root.getList("CUSTOMER").size());
View Full Code Here


        Command select = das.createCommand("Select * from CUSTOMER where ID = 1");
        DataObject root = select.executeQuery();
        assertFalse(root.get("CUSTOMER[1]/LASTNAME").equals("Pavick"));

        Command update = das.createCommand("update CUSTOMER set LASTNAME = 'Pavick' where ID = 1");
        update.execute();

        // Verify update - reuse select command
        root = select.executeQuery();
        assertEquals("Pavick", root.get("CUSTOMER[1]/LASTNAME"));

View Full Code Here

        assertFalse(root.get("CUSTOMER[1]/LASTNAME").equals("Pavick"));

        Command update = das.createCommand("update CUSTOMER set LASTNAME = ? where ID = ?");
        update.setParameter(1, "Pavick");
        update.setParameter(2, new Integer(1));
        update.execute();

        // Verify update - reuse select command
        root = select.executeQuery();
        assertEquals("Pavick", root.get("CUSTOMER[1]/LASTNAME"));
View Full Code Here

        assertFalse(root.get("CUSTOMER[1]/LASTNAME").equals("Pavick"));

        Command update = das.createCommand("update CUSTOMER set LASTNAME = ? where ID = ?");
        update.setParameter(1, "Pavick");
        update.setParameter(2, new Integer(1));
        update.execute();

        //Verify update - reuse select command
        root = select.executeQuery();
        assertEquals("Pavick", root.get("CUSTOMER[1]/LASTNAME"));
View Full Code Here

     
      //insert same image
      Command insert = das.createCommand("INSERT INTO DOCUMENTS_IMAGES (ID, TEXT) VALUES (?,?)");
      insert.setParameter(1, new Integer(101));
      insert.setParameter(2, txtClob);
      insert.execute();
     
      //Select again
      Command readNew = das.createCommand("SELECT TEXT FROM DOCUMENTS_IMAGES WHERE id = 101");
      root = readNew.executeQuery();
      result = root.getList("DOCUMENTS_IMAGES");
View Full Code Here

      //see order is not maintained, but config depicts it through index attrb
      //if index is missing , auto increment logic will be followed
      insert.setParameter("LASTNAME", "Louise");
      insert.setParameter("ADDRESS", "TPO");
      insert.setParameter("ID", new Integer(6));
      insert.execute();
      select.setParameter("ID", new Integer(6));
      root = select.executeQuery();
      customers = root.getList("CUSTOMER");
      assertEquals(1, customers.size());
      customer = (DataObject)customers.get(0);
View Full Code Here

      Command insertNoParam = das.getCommand("createCustomerNoParam");
      //if param/index is missing in cfg, auto increment logic will be followed
      insertNoParam.setParameter("ID", new Integer(7));
      insertNoParam.setParameter("LASTNAME", "Louise7");
      insertNoParam.setParameter("ADDRESS", "TPO7");
      insertNoParam.execute();
      select.setParameter("ID", new Integer(7));
      root = select.executeQuery();
      customers = root.getList("CUSTOMER");
      assertEquals(1, customers.size());
      customer = (DataObject)customers.get(0);
View Full Code Here

     
      //update
      Command update = das.getCommand("updateCustomer");
      update.setParameter("LASTNAME", "NoLouise");
      update.setParameter("ID", new Integer(6));
      update.execute();
      select.setParameter("ID", new Integer(6));
      root = select.executeQuery();
      customers = root.getList("CUSTOMER");
      assertEquals(1, customers.size());
      customer = (DataObject)customers.get(0);
View Full Code Here

     
      //update - no param in config
      Command updateNoParam = das.getCommand("updateCustomerNoParam");
      updateNoParam.setParameter("LASTNAME", "YesLouise");
      updateNoParam.setParameter("ID", new Integer(6));
      updateNoParam.execute();
      select.setParameter("ID", new Integer(6));
      root = select.executeQuery();
      customers = root.getList("CUSTOMER");
      assertEquals(1, customers.size());
      customer = (DataObject)customers.get(0);
View Full Code Here

      assertEquals("YesLouise", customer.get("LASTNAME"));
     
      //delete
      Command delete = das.getCommand("deleteCustomer");
      delete.setParameter("ID", new Integer(6));
      delete.execute();
      select.setParameter("ID", new Integer(6));
      root = select.executeQuery();
      customers = root.getList("CUSTOMER");
      assertEquals(0, customers.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.