Search in sources :

Example 1 with ParallQueryExtend

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;
}
Also used : ParallQueryExtend(org.sagacity.sqltoy.model.inner.ParallQueryExtend) QueryExecutor(org.sagacity.sqltoy.model.QueryExecutor) ParallQueryResult(org.sagacity.sqltoy.model.ParallQueryResult)

Aggregations

ParallQueryResult (org.sagacity.sqltoy.model.ParallQueryResult)1 QueryExecutor (org.sagacity.sqltoy.model.QueryExecutor)1 ParallQueryExtend (org.sagacity.sqltoy.model.inner.ParallQueryExtend)1