Examples of IPredicate


Examples of net.floodlightcontroller.storage.IPredicate

        String[] columnList = {PERSON_FIRST_NAME,PERSON_LAST_NAME};
        Object[][] expectedResults = {
                {"Lisa", "Jones"},
                {"Susan", "Jones"}
        };
        IPredicate predicate = new OperatorPredicate(PERSON_LAST_NAME, OperatorPredicate.Operator.EQ, "Jones");
        IQuery query = storageSource.createQuery(PERSON_TABLE_NAME, columnList, predicate, new RowOrdering(PERSON_SSN));
        IResultSet resultSet = storageSource.executeQuery(query);
        checkExpectedResults(resultSet, columnList, expectedResults);
    }
View Full Code Here

Examples of net.floodlightcontroller.storage.IPredicate

        Object[][] expectedResults = {
                {"John", "Smith", 40},
                {"Bjorn", "Borg", 55},
                {"John", "McEnroe", 53}
        };
        IPredicate predicate = new OperatorPredicate(PERSON_AGE, OperatorPredicate.Operator.GTE, "?MinimumAge?");
        IQuery query = storageSource.createQuery(PERSON_TABLE_NAME, columnList, predicate, new RowOrdering(PERSON_SSN));
        query.setParameter("MinimumAge", 40);
        IResultSet resultSet = storageSource.executeQuery(query);
        checkExpectedResults(resultSet, columnList, expectedResults);
    }
View Full Code Here

Examples of net.floodlightcontroller.storage.IPredicate

    public void testRowMapper() {
        Object[][] expectedResults = {
                PERSON_INIT_DATA[2],
                PERSON_INIT_DATA[3]
        };
        IPredicate predicate = new OperatorPredicate(PERSON_LAST_NAME, OperatorPredicate.Operator.EQ, "Jones");
        IRowMapper rowMapper = new PersonRowMapper();
        Object[] personList = storageSource.executeQuery(PERSON_TABLE_NAME, null, predicate, new RowOrdering(PERSON_SSN), rowMapper);
        assertEquals(personList.length, 2);
        for (int i = 0; i < personList.length; i++)
            checkPerson((Person)personList[i], expectedResults[i]);
View Full Code Here

Examples of net.floodlightcontroller.storage.IPredicate

        };
        Map<String,Object> updateValues = new HashMap<String,Object>();
        updateValues.put(PERSON_FIRST_NAME, "Tennis");
        updateValues.put(PERSON_AGE, 60);
       
        IPredicate predicate = new OperatorPredicate(PERSON_AGE, OperatorPredicate.Operator.GT, 50);
        IResultSet resultSet = storageSource.executeQuery(PERSON_TABLE_NAME, null, predicate, new RowOrdering(PERSON_SSN));
        while (resultSet.next()) {
            String key = resultSet.getString(PERSON_SSN);
            storageSource.updateRow(PERSON_TABLE_NAME, key, updateValues);
        }
View Full Code Here

Examples of net.floodlightcontroller.storage.IPredicate

        Object[][] expectedResults = {
                {"777-77-7777", "Tennis", "Borg", 60, true},
                {"888-88-8888", "Tennis", "McEnroe", 60, false}
        };
       
        IPredicate predicate = new OperatorPredicate(PERSON_AGE, OperatorPredicate.Operator.GT, 50);
        IResultSet resultSet = storageSource.executeQuery(PERSON_TABLE_NAME, null, predicate, null);
        while (resultSet.next()) {
            resultSet.setString(PERSON_FIRST_NAME, "Tennis");
            resultSet.setInt(PERSON_AGE, 60);
        }
View Full Code Here

Examples of net.floodlightcontroller.storage.IPredicate

    }
   
    @Test
    public void testNullValues() {
       
        IPredicate predicate = new OperatorPredicate(PERSON_LAST_NAME, OperatorPredicate.Operator.EQ, "Jones");
        IResultSet resultSet = storageSource.executeQuery(PERSON_TABLE_NAME, null, predicate, new RowOrdering(PERSON_SSN));
        while (resultSet.next()) {
            resultSet.setNull(PERSON_FIRST_NAME);
            resultSet.setIntegerObject(PERSON_AGE, null);
        }
View Full Code Here

Examples of net.floodlightcontroller.storage.IPredicate

        Object[][] expectedResults = {
                {"John", "Smith", 40},
                {"Jim", "White", 24},
        };
        String[] columnList = {PERSON_FIRST_NAME,PERSON_LAST_NAME,PERSON_AGE};
        IPredicate predicate = new OperatorPredicate(PERSON_LAST_NAME, OperatorPredicate.Operator.GTE, "Sm");
        IQuery query = storageSource.createQuery(PERSON_TABLE_NAME, columnList, predicate, new RowOrdering(PERSON_SSN));
        Future<IResultSet> future = storageSource.executeQueryAsync(query);
        waitForFuture(future);
        try {
            IResultSet resultSet = future.get();
View Full Code Here

Examples of net.floodlightcontroller.storage.IPredicate

        Object[][] expectedResults = {
                {"John", "Smith", 40},
                {"Jim", "White", 24},
        };
        String[] columnList = {PERSON_FIRST_NAME,PERSON_LAST_NAME,PERSON_AGE};
        IPredicate predicate = new OperatorPredicate(PERSON_LAST_NAME, OperatorPredicate.Operator.GTE, "Sm");
        Future<IResultSet> future = storageSource.executeQueryAsync(PERSON_TABLE_NAME,
                columnList, predicate, new RowOrdering(PERSON_SSN));
        waitForFuture(future);
        try {
            IResultSet resultSet = future.get();
View Full Code Here

Examples of net.floodlightcontroller.storage.IPredicate

    public void testAsyncQuery3() {
        Object[][] expectedResults = {
                PERSON_INIT_DATA[2],
                PERSON_INIT_DATA[3]
        };
        IPredicate predicate = new OperatorPredicate(PERSON_LAST_NAME, OperatorPredicate.Operator.EQ, "Jones");
        IRowMapper rowMapper = new PersonRowMapper();
        Future<Object[]> future = storageSource.executeQueryAsync(PERSON_TABLE_NAME,
                null, predicate, new RowOrdering(PERSON_SSN), rowMapper);
        waitForFuture(future);
        try {
View Full Code Here

Examples of net.floodlightcontroller.storage.IPredicate

    public void testAsyncUpdateMatchingRows() {
        Map<String,Object> updateValues = new HashMap<String,Object>();
        updateValues.put(PERSON_FIRST_NAME, "Tennis");
        updateValues.put(PERSON_AGE, 60);

        IPredicate predicate = new OperatorPredicate(PERSON_SSN, OperatorPredicate.Operator.EQ, "777-77-7777");
        Future<?> future = storageSource.updateMatchingRowsAsync(PERSON_TABLE_NAME, predicate, updateValues);
        waitForFuture(future);
        try {
            IResultSet resultSet = storageSource.getRow(PERSON_TABLE_NAME, "777-77-7777");
            Object[][] expectedPersons = {{"777-77-7777", "Tennis", "Borg", 60, true}};
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.