本文整理汇总了Java中com.ibatis.sqlmap.client.SqlMapClient.queryForList方法的典型用法代码示例。如果您正苦于以下问题:Java SqlMapClient.queryForList方法的具体用法?Java SqlMapClient.queryForList怎么用?Java SqlMapClient.queryForList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.ibatis.sqlmap.client.SqlMapClient
的用法示例。
在下文中一共展示了SqlMapClient.queryForList方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: nullParametersShouldNotBeTraced
import com.ibatis.sqlmap.client.SqlMapClient; //导入方法依赖的package包/类
@Test
public void nullParametersShouldNotBeTraced() throws Exception {
// Given
SqlMapClient sqlMapClient = new SqlMapClientImpl(this.mockSqlMapExecutorDelegate);
// When
sqlMapClient.insert(null);
sqlMapClient.queryForList(null);
// Then
final List<SpanEventBo> spanEvents = getCurrentSpanEvents();
assertThat(spanEvents.size(), is(2));
// Check Method
final SpanEventBo insertSpanEventBo = spanEvents.get(0);
final SpanEventBo queryForListSpanEventBo = spanEvents.get(1);
assertThat(insertSpanEventBo.getApiId(), not(0));
assertThat(queryForListSpanEventBo.getApiId(), not(0));
assertThat(insertSpanEventBo.getApiId(), not(queryForListSpanEventBo.getApiId()));
// Check Parameter
assertNull(insertSpanEventBo.getAnnotationBoList());
assertNull(queryForListSpanEventBo.getAnnotationBoList());
}
示例2: queryForListShouldBeTraced
import com.ibatis.sqlmap.client.SqlMapClient; //导入方法依赖的package包/类
@Test
public void queryForListShouldBeTraced() throws Exception {
// Given
SqlMapClient sqlMapClient = new SqlMapClientImpl(this.mockSqlMapExecutorDelegate);
// When
sqlMapClient.queryForList("abc");
// Then
final List<SpanEventBo> spanEvents = getCurrentSpanEvents();
assertThat(spanEvents.size(), is(1));
// Check Method
final SpanEventBo apiCallSpanEventBo = spanEvents.get(0);
assertThat(apiCallSpanEventBo.getApiId(), not(0));
// Check Parameter
final List<AnnotationBo> annotationBoList = apiCallSpanEventBo.getAnnotationBoList();
assertThat(annotationBoList.size(), is(1));
final AnnotationBo parameterAnnotationBo = annotationBoList.get(0);
assertThat(parameterAnnotationBo.getKey(), is(AnnotationKey.CACHE_ARGS0.getCode()));
}
示例3: retrieveFeed
import com.ibatis.sqlmap.client.SqlMapClient; //导入方法依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public Feed retrieveFeed(RequestContext request) throws FeedServerAdapterException {
SqlMapClient client = getSqlMapClient();
String queryId = config.getFeedId() + "-get-feed";
List<Map<String, Object>> rows;
try {
rows = client.queryForList(queryId, getRequestParams(request));
} catch (SQLException e) {
throw new FeedServerAdapterException(
FeedServerAdapterException.Reason.ERROR_EXECUTING_ADAPTER_REQUEST, e.getMessage());
}
Feed feed = createFeed();
ServerConfiguration serverConfig = config.getServerConfiguration();
if (serverConfig.getFeedNamespacePrefix() != null
&& serverConfig.getFeedNamespacePrefix().length() > 0) {
feed.declareNS(serverConfig.getFeedNamespace(), serverConfig.getFeedNamespacePrefix());
}
for (Map<String, Object> row : rows) {
createEntryFromProperties(feed, row);
}
return feed;
}
示例4: doQueryForList
import com.ibatis.sqlmap.client.SqlMapClient; //导入方法依赖的package包/类
private void doQueryForList(Exchange exchange) throws Exception {
SqlMapClient client = endpoint.getSqlMapClient();
Object result;
Object in = exchange.getIn().getBody();
if (in != null) {
LOG.trace("QueryForList: {} using statement: {}", in, statement);
result = client.queryForList(statement, in);
} else {
LOG.trace("QueryForList using statement: {}", statement);
result = client.queryForList(statement);
}
doProcessResult(exchange, result);
}
示例5: poll
import com.ibatis.sqlmap.client.SqlMapClient; //导入方法依赖的package包/类
@SuppressWarnings("unchecked")
public List<Object> poll(IBatisConsumer consumer, IBatisEndpoint endpoint) throws Exception {
SqlMapClient client = endpoint.getSqlMapClient();
return client.queryForList(endpoint.getStatement(), null);
}