use of org.sagacity.sqltoy.model.inner.ParallQueryExtend in project sagacity-sqltoy by chenrenfei.
the class ParallQueryExecutor method call.
@Override
public ParallQueryResult call() {
ParallQueryResult result = new ParallQueryResult();
try {
ParallQueryExtend extend = parallQuery.getExtend();
QueryExecutor queryExecutor = new QueryExecutor(extend.sql).resultType(extend.resultType).names(paramNames).values(paramValues);
// 分页
if (extend.page != null) {
result.setResult(dialectFactory.findPage(sqlToyContext, queryExecutor, sqlToyConfig, extend.page.getPageNo(), extend.page.getPageSize(), dataSource));
} else {
result.setResult(dialectFactory.findByQuery(sqlToyContext, queryExecutor, sqlToyConfig, null, dataSource));
}
} catch (Exception e) {
result.setSuccess(false);
result.setMessage(e.getMessage());
}
return result;
}
Aggregations