Examples of MCur


Examples of org.nutz.mongo.util.MCur

  /**核心查询方法,通用查询*/
  public Pager<Question> query(QuestionQuery query) {
    if (query == null)
      query = new QuestionQuery();
    MCur cur = MCur.DESC("updatedAt");
    Pager<Question> pager = new Pager<Question>();
    pager.setCount(dao.count(Question.class, query.q));
    pager.setPage(query.page);
    pager.setPageSize(query.pageSize);
    if (query.skip() > 0)
      cur.skip(query.skip());
    if (query.limit() > 0
      cur.limit(query.limit());
    pager.setData(dao.find(Question.class, query.q, cur));
    return pager;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.