Package org.apache.tuscany.das.rdb

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


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

        Command read = commandGroup.getCommand("get companies with employee of the month");
        DataObject root = read.executeQuery();
        DataObject company = root.getDataObject("COMPANY[1]");
        company.setDataObject("company->employee_opposite", null);
        assertNull(company.getDataObject("company->employee_opposite"));
  
        //Flush changes
View Full Code Here


  
        //Flush changes
        commandGroup.getApplyChangesCommand().execute(root);

        //Verify
        root = read.executeQuery();
        company = root.getDataObject("COMPANY[1]");
        assertNull(company.getDataObject("company->employee_opposite"));
    }
   
    /**
 
View Full Code Here

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

        Command read = commandGroup.getCommand("get companies with employee of the month");
        DataObject root = read.executeQuery();
        DataObject company = root.getDataObject("COMPANY[1]");
        DataObject employee = company.getDataObject("company->employee_opposite");
        employee.delete();
        assertNull(company.getDataObject("company->employee_opposite"));
  
View Full Code Here

  
        //Flush changes
        commandGroup.getApplyChangesCommand().execute(root);

        //Verify
        root = read.executeQuery();
        company = root.getDataObject("COMPANY[1]");
        assertNull(company.getDataObject("company->employee_opposite"));
    }
   
    /**
 
View Full Code Here

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

        Command read = commandGroup.getCommand("get companies with employee of the month");
        DataObject root = read.executeQuery();
        DataObject company = root.getDataObject("COMPANY[1]");
       
        //Create a new employee
        DataObject employee = root.createDataObject("EMPLOYEE");
        employee.setString ("NAME", "Joe Hotshot");
View Full Code Here

        
        //Flush changes
        commandGroup.getApplyChangesCommand().execute(root);

        //Verify
        root = read.executeQuery();
        company = root.getDataObject("COMPANY[1]");
       
        employee = root.getDataObject("COMPANY[1]/company->employee_opposite");

        assertEquals("Joe Hotshot", employee.getString("NAME"));
View Full Code Here

    select.setParameterValue("LASTNAME", "Williams");
    TypeHelper helper = TypeHelper.INSTANCE;
   
    select.setDataObjectModel(helper.getType(DataGraphRoot.class));
   
    DataGraphRoot root = (DataGraphRoot) select.executeQuery();
   
    Collection customers = root.getCustomers();
    assertEquals(4, customers.size());
  }
View Full Code Here

    Type[] types = { SDODataTypes.INTEGEROBJECT, SDODataTypes.DATE, SDODataTypes.STRING };
    ResultSetShape shape = new ResultSetShape(tables, columns, types);
    read.setResultSetShape(shape);
           
    //Read
    DataObject root = read.executeQuery();
   
    //Verify
    assertEquals(kbday, root.getDate("CUSTOMER[1]/LASTNAME"));
   
    //Modify
View Full Code Here

    ApplyChangesCommand write = Command.FACTORY.createApplyChangesCommand(getConfig("CustomerConfigWithConverter.xml"));
    write.setConnection(getConnection());
    write.execute(root);
   
    //Read
    root = read.executeQuery();

    //Verify
    assertEquals(tbday, root.getDate("CUSTOMER[1]/LASTNAME"));
   
  }
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

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.