当前位置: 首页>>代码示例>>Java>>正文


Java IQuery类代码示例

本文整理汇总了Java中net.floodlightcontroller.storage.IQuery的典型用法代码示例。如果您正苦于以下问题:Java IQuery类的具体用法?Java IQuery怎么用?Java IQuery使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


IQuery类属于net.floodlightcontroller.storage包,在下文中一共展示了IQuery类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testAsyncQuery1

import net.floodlightcontroller.storage.IQuery; //导入依赖的package包/类
@Test
public void testAsyncQuery1() {
    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();
        checkExpectedResults(resultSet, columnList, expectedResults);
    }
    catch (Exception e) {
        fail("Exception thrown in async storage operation: " + e.toString());
    }
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:20,代码来源:StorageTest.java

示例2: executeQueryImpl

import net.floodlightcontroller.storage.IQuery; //导入依赖的package包/类
@Override
public IResultSet executeQueryImpl(IQuery query) {
    NoSqlQuery noSqlQuery = (NoSqlQuery) query;
    return executeParameterizedQuery(noSqlQuery.getTableName(),
            noSqlQuery.getColumnNameList(), noSqlQuery.getPredicate(),
            noSqlQuery.getRowOrdering(), noSqlQuery.getParameterMap());
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:8,代码来源:NoSqlStorageSource.java

示例3: testCreateQuery

import net.floodlightcontroller.storage.IQuery; //导入依赖的package包/类
@Test
public void testCreateQuery() {
    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);
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:13,代码来源:StorageTest.java

示例4: testQueryParameters

import net.floodlightcontroller.storage.IQuery; //导入依赖的package包/类
@Test
public void testQueryParameters() {
    String[] columnList = {PERSON_FIRST_NAME,PERSON_LAST_NAME, PERSON_AGE};        
    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);
}
 
开发者ID:xuraylei,项目名称:fresco_floodlight,代码行数:15,代码来源:StorageTest.java


注:本文中的net.floodlightcontroller.storage.IQuery类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。