Search in sources :

Example 1 with DaoPage

use of com.baidu.ub.common.db.DaoPage in project disconf by knightliao.

the class DaoUtils method daoPageAdapter.

/**
     * 将业务的Page转成Dao的Page
     *
     * @param page
     *
     * @return
     */
public static DaoPage daoPageAdapter(Page page) {
    DaoPage daoPage = new DaoPage();
    daoPage.setPageNo(page.getPageNo());
    daoPage.setPageSize(page.getPageSize());
    List<Order> orderList = new ArrayList<Order>();
    if (!StringUtils.isEmpty(page.getOrderBy())) {
        Order order = new Order(page.getOrderBy(), page.isAsc());
        orderList.add(order);
    }
    daoPage.setOrderList(orderList);
    return daoPage;
}
Also used : Order(com.baidu.unbiz.common.genericdao.operator.Order) ArrayList(java.util.ArrayList) DaoPage(com.baidu.ub.common.db.DaoPage)

Example 2 with DaoPage

use of com.baidu.ub.common.db.DaoPage in project disconf by knightliao.

the class ConfigDaoImpl method getConfigList.

/**
     *
     */
@Override
public DaoPageResult<Config> getConfigList(Long appId, Long envId, String version, Page page) {
    DaoPage daoPage = DaoUtils.daoPageAdapter(page);
    List<Match> matchs = new ArrayList<Match>();
    matchs.add(new Match(Columns.APP_ID, appId));
    matchs.add(new Match(Columns.ENV_ID, envId));
    matchs.add(new Match(Columns.VERSION, version));
    matchs.add(new Match(Columns.STATUS, Constants.STATUS_NORMAL));
    return page2(matchs, daoPage);
}
Also used : ArrayList(java.util.ArrayList) DaoPage(com.baidu.ub.common.db.DaoPage) Match(com.baidu.unbiz.common.genericdao.operator.Match)

Aggregations

DaoPage (com.baidu.ub.common.db.DaoPage)2 ArrayList (java.util.ArrayList)2 Match (com.baidu.unbiz.common.genericdao.operator.Match)1 Order (com.baidu.unbiz.common.genericdao.operator.Order)1