Package ru.bgcrm.model

# Class Page

java.lang.Object
ru.bgcrm.model.Page

public class Page extends Object
Pagination data.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final int`
  `DEFAULT_PAGE_SIZE`
  `static final String`
  `PAGE_COUNT`
  `static final String`
  `PAGE_INDEX`
  `static int`
  `PAGE_INDEX_NO_PAGING`
  `static final String`
  `PAGE_SIZE`
  `static final String`
  `PAGEABLE_ID`
  `static final String`
  `RECORD_COUNT`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Page()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getLimitSql()`
  Generates page `LIMIT offset, rows` query.
  `int`
  `getPageCount()`
  `int`
  `getPageFirstRecordNumber()`
  `int`
  `getPageIndex()`
  `int`
  `getPageSize()`
  `int`
  `getRecordCount()`
  `boolean`
  `isPaginationEnabled()`
  `void`
  `setData(Page page)`
  `void`
  `setPageCount(int pageCount)`
  `void`
  `setPageIndex(int value)`
  Sets page index.
  `void`
  `setPageSize(int pageSize)`
  `void`
  `setRecordCount(int recordCount)`
  Set record count and calculated amount of pages
  `void`
  `setRecordCount(Statement st)`
  Set record count from found rows in SQL statement

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### DEFAULT_PAGE_SIZE

    public static final int DEFAULT_PAGE_SIZE
    See Also:
      - Constant Field Values

  - ### RECORD_COUNT

    public static final String RECORD_COUNT
    See Also:
      - Constant Field Values

  - ### PAGE_COUNT

    public static final String PAGE_COUNT
    See Also:
      - Constant Field Values

  - ### PAGE_INDEX

    public static final String PAGE_INDEX
    See Also:
      - Constant Field Values

  - ### PAGE_SIZE

    public static final String PAGE_SIZE
    See Also:
      - Constant Field Values

  - ### PAGEABLE_ID

    public static final String PAGEABLE_ID
    See Also:
      - Constant Field Values

  - ### PAGE_INDEX_NO_PAGING

    public static int PAGE_INDEX_NO_PAGING

- ## Constructor Details

  - ### Page

    public Page()

- ## Method Details

  - ### setData

    public void setData(Page page)

  - ### isPaginationEnabled

    public boolean isPaginationEnabled()
    Returns:
      `pageIndex &gt; 0`

  - ### getPageIndex

    public int getPageIndex()

  - ### setPageIndex

    public void setPageIndex(int value)
    Sets page index.
    Parameters:
      `value` - required page index, `PAGE_INDEX_NO_PAGING` for disabling pagination.

  - ### getPageSize

    public int getPageSize()

  - ### setPageSize

    public void setPageSize(int pageSize)

  - ### getPageCount

    public int getPageCount()

  - ### setPageCount

    public void setPageCount(int pageCount)

  - ### getPageFirstRecordNumber

    public int getPageFirstRecordNumber()

  - ### getRecordCount

    public int getRecordCount()

  - ### getLimitSql

    public String getLimitSql()
    Generates page `LIMIT offset, rows` query.
    Parameters:
      `page` - page instance.
    Returns:

  - ### setRecordCount

    public void setRecordCount(int recordCount)
    Set record count and calculated amount of pages
    Parameters:
      `recordCount` -

  - ### setRecordCount

    public void setRecordCount(Statement st) throws SQLException
    Set record count from found rows in SQL statement
    Parameters:
      `st` - the SQL statement
    Throws:
      `SQLException`