本文整理汇总了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());
}
}
示例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());
}
示例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);
}
示例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);
}