Package org.springframework.batch.item.database.support

# Class PostgresPagingQueryProvider

java.lang.Object
org.springframework.batch.item.database.support.AbstractSqlPagingQueryProvider
org.springframework.batch.item.database.support.PostgresPagingQueryProvider

All Implemented Interfaces:
  `PagingQueryProvider`

public class PostgresPagingQueryProvider extends AbstractSqlPagingQueryProvider
Postgres implementation of a `PagingQueryProvider` using database specific features. When using the groupClause, this implementation expects all select fields not used in aggregate functions to be included in the groupClause (the provider does not add them for you).

Since:
  2.0
Author:
  Thomas Risberg, Michael Minella, Mahmoud Ben Hassine

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `PostgresPagingQueryProvider()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `generateFirstPageQuery(int pageSize)`
  Method generating the query string to be used for retrieving the first page.
  `String`
  `generateJumpToItemQuery(int itemIndex, int pageSize)`
  Method generating the query string to be used for jumping to a specific item position.
  `String`
  `generateRemainingPagesQuery(int pageSize)`
  Method generating the query string to be used for retrieving the pages following the first page.

  ### Methods inherited from class org.springframework.batch.item.database.support.AbstractSqlPagingQueryProvider

  `getFromClause, getGroupClause, getParameterCount, getSelectClause, getSortKeyPlaceHolder, getSortKeys, getSortKeysWithoutAliases, getWhereClause, init, isUsingNamedParameters, setFromClause, setGroupClause, setSelectClause, setSortKeys, setWhereClause`

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

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

- ## Constructor Details

  - ### PostgresPagingQueryProvider

    public PostgresPagingQueryProvider()

- ## Method Details

  - ### generateFirstPageQuery

    public String generateFirstPageQuery(int pageSize)
    Description copied from class: `AbstractSqlPagingQueryProvider`
    Method generating the query string to be used for retrieving the first page. This method must be implemented in sub classes.
    Specified by:
      `generateFirstPageQuery` in interface `PagingQueryProvider`
    Specified by:
      `generateFirstPageQuery` in class `AbstractSqlPagingQueryProvider`
    Parameters:
      `pageSize` - number of rows to read per page
    Returns:
      query string

  - ### generateRemainingPagesQuery

    public String generateRemainingPagesQuery(int pageSize)
    Description copied from class: `AbstractSqlPagingQueryProvider`
    Method generating the query string to be used for retrieving the pages following the first page. This method must be implemented in sub classes.
    Specified by:
      `generateRemainingPagesQuery` in interface `PagingQueryProvider`
    Specified by:
      `generateRemainingPagesQuery` in class `AbstractSqlPagingQueryProvider`
    Parameters:
      `pageSize` - number of rows to read per page
    Returns:
      query string

  - ### generateJumpToItemQuery

    public String generateJumpToItemQuery(int itemIndex, int pageSize)
    Description copied from class: `AbstractSqlPagingQueryProvider`
    Method generating the query string to be used for jumping to a specific item position. This method must be implemented in sub classes.
    Specified by:
      `generateJumpToItemQuery` in interface `PagingQueryProvider`
    Specified by:
      `generateJumpToItemQuery` in class `AbstractSqlPagingQueryProvider`
    Parameters:
      `itemIndex` - the index of the item to jump to
      `pageSize` - number of rows to read per page
    Returns:
      query string