Hyperic HQ Plugin API v. 4.4.0.2

org.hyperic.hibernate
Class PageInfo

java.lang.Object
  extended by org.hyperic.hibernate.PageInfo

public class PageInfo
extends java.lang.Object

A paging class that knows a little about Hibernate.


Method Summary
static PageInfo create(int pageNum, int pageSize, SortField sort, boolean ascending)
           
static PageInfo create(PageControl pc, SortField sort)
           
static PageInfo getAll(SortField sort, boolean ascending)
          Returns a page control which will return all elements (not paged)
 int getPageNum()
          Get the page number.
 int getPageSize()
          Get the max # of elements per page
 SortField getSort()
          Gets the field to sort on
 int getStartRow()
          Returns the absolute index of the first row that the page points at.
 boolean isAll()
           
 boolean isAscending()
           
 org.hibernate.Query pageResults(org.hibernate.Query q)
          Modifies a Hibernate query to conform to the paging specs in this PageInfo object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getPageNum

public int getPageNum()
Get the page number. The first page is page 0.


getPageSize

public int getPageSize()
Get the max # of elements per page


getStartRow

public int getStartRow()
Returns the absolute index of the first row that the page points at.


getSort

public SortField getSort()
Gets the field to sort on


isAscending

public boolean isAscending()

isAll

public boolean isAll()

pageResults

public org.hibernate.Query pageResults(org.hibernate.Query q)
Modifies a Hibernate query to conform to the paging specs in this PageInfo object. This only changes this method makes are to the page offset and result count. Sort order must be dealt with elsewhere.


create

public static PageInfo create(int pageNum,
                              int pageSize,
                              SortField sort,
                              boolean ascending)

getAll

public static PageInfo getAll(SortField sort,
                              boolean ascending)
Returns a page control which will return all elements (not paged)


create

public static PageInfo create(PageControl pc,
                              SortField sort)

Hyperic HQ Plugin API v. 4.4.0.2

Copyright © 2004-2006 Hyperic, Inc. support@hyperic.net, All Rights Reserved.