Package org.damour.base.client.objects

Examples of org.damour.base.client.objects.PageInfo


    String query = buildQuery(parent, clazz, authUser, "id", true);
    return (Long) session.createQuery("select count(*) " + query).setCacheable(true).uniqueResult();
  }

  public static PageInfo getPageInfo(Session session, PermissibleObject parent, Class<?> clazz, User authUser, int pageSize) {
    PageInfo pageInfo = new PageInfo();
    long rowCount = getRowCount(session, parent, clazz, authUser);
    long lastPageNumber = new Double(Math.floor((double) (rowCount - 1) / pageSize)).longValue();
    pageInfo.setTotalRowCount(rowCount);
    pageInfo.setLastPageNumber(lastPageNumber);
    return pageInfo;
  }
View Full Code Here


        System.out.print(obj.getName() + ":" + obj.getAverageRating() + " ");
      }
      System.out.println();
    }

    PageInfo pageInfo = PageHelper.getPageInfo(session, null, Photo.class, null, 10);
    System.out.println("Row Count: " + pageInfo.getTotalRowCount());
    System.out.println("Last Page: " + pageInfo.getLastPageNumber());
   
    tx = session.beginTransaction();
    for (Photo photo : photosList) {
      session.delete(photo);
    }
View Full Code Here

TOP

Related Classes of org.damour.base.client.objects.PageInfo

Copyright © 2018 www.massapicom. 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.