Search in sources :

Example 6 with Page

use of org.sagacity.sqltoy.model.Page in project sagacity-sqltoy by chenrenfei.

the class SqlToyDaoSupport method convertType.

protected <T extends Serializable> Page<T> convertType(Page sourcePage, Class<T> resultType) {
    if (sourcePage == null) {
        return null;
    }
    Page result = new Page();
    result.setPageNo(sourcePage.getPageNo());
    result.setPageSize(sourcePage.getPageSize());
    result.setRecordCount(sourcePage.getRecordCount());
    result.setSkipQueryCount(sourcePage.getSkipQueryCount());
    if (sourcePage.getRows().isEmpty()) {
        return result;
    }
    result.setRows(convertType(sourcePage.getRows(), resultType));
    return result;
}
Also used : Page(org.sagacity.sqltoy.model.Page)

Aggregations

Page (org.sagacity.sqltoy.model.Page)6 SqlToyConfig (org.sagacity.sqltoy.config.model.SqlToyConfig)2 QueryExecutor (org.sagacity.sqltoy.model.QueryExecutor)2 DataSetResult (org.sagacity.sqltoy.model.inner.DataSetResult)2 QueryExecutorExtend (org.sagacity.sqltoy.model.inner.QueryExecutorExtend)2 JSONObject (com.alibaba.fastjson.JSONObject)1 Document (org.bson.Document)1 ElasticEndpoint (org.sagacity.sqltoy.config.model.ElasticEndpoint)1 NoSqlConfigModel (org.sagacity.sqltoy.config.model.NoSqlConfigModel)1 DataAccessException (org.sagacity.sqltoy.exception.DataAccessException)1 BasicQuery (org.springframework.data.mongodb.core.query.BasicQuery)1