SHARE
TWEET

Untitled

a guest Jun 19th, 2019 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. urlList = nodeFacade.list_url((pageNo - 1) * pageSize, pageSize, sortName, sortorder);
  2.      
  3. public List<UrllinkEntity> list_url(int offset, int limit, String orderBy, String order) {
  4.         try {
  5.             String sql = "SELECT g FROM UrllinkEntity as g ";
  6.  
  7.             if (orderBy != null) {
  8.                 sql += "order by lower(" + orderBy + ") " + order;
  9.             }
  10.  
  11.             Query q = em.createQuery(sql);
  12.             q.setFirstResult(offset);
  13.  
  14.             if (limit != 0) {
  15.                 q.setMaxResults(limit);
  16.             }
  17.  
  18.             List modList = q.getResultList();
  19.  
  20.             return modList;
  21.         } catch (Exception e) {
  22.             msg = CoreUtil.wrapMsg(CoreUtil.FUNC_ERROR,
  23.                     this.getClass().getName(), "list_url", e.getMessage());
  24.  
  25.             return null;
  26.         }
  27.     }
  28.      
  29. Query selectQuery = session.createQuery("SELECT g FROM UrllinkEntity as g ");
  30. selectQuery.setFirstResult((lastPageNumber - 1) * pageSize);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top