Package org.springframework.cloud.task.repository.database.support

# Class SqlPagingQueryUtils

java.lang.Object
org.springframework.cloud.task.repository.database.support.SqlPagingQueryUtils

public final class SqlPagingQueryUtils extends Object
Utility class that generates the actual SQL statements used by query providers.

Author:
  Glenn Renfro

- ## Method Summary

  Modifier and Type
  Method
  Description
  `static String`
  `buildSortClause(Map<String,org.springframework.batch.item.database.Order> sortKeys)`
  Generates ORDER BY attributes based on the sort keys.
  `static String`
  `buildSortClause(AbstractSqlPagingQueryProvider provider)`
  Generates ORDER BY attributes based on the sort keys.
  `static void`
  `buildWhereClause(AbstractSqlPagingQueryProvider provider, boolean remainingPageQuery, StringBuilder sql)`
  Generates WHERE clause for queries that require sub selects.
  `static String`
  `generateLimitJumpToQuery(AbstractSqlPagingQueryProvider provider, String limitClause)`
  Generate SQL query string using a LIMIT clause.
  `static String`
  `generateTopJumpToQuery(AbstractSqlPagingQueryProvider provider, String topClause)`
  Generate SQL query string using a TOP clause.

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

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

- ## Method Details

  - ### generateLimitJumpToQuery

    public static String generateLimitJumpToQuery(AbstractSqlPagingQueryProvider provider, String limitClause)
    Generate SQL query string using a LIMIT clause.
    Parameters:
      `provider` - `AbstractSqlPagingQueryProvider` providing the implementation specifics
      `limitClause` - the implementation specific top clause to be used
    Returns:
      the generated query

  - ### generateTopJumpToQuery

    public static String generateTopJumpToQuery(AbstractSqlPagingQueryProvider provider, String topClause)
    Generate SQL query string using a TOP clause.
    Parameters:
      `provider` - `AbstractSqlPagingQueryProvider` providing the implementation specifics
      `topClause` - the implementation specific top clause to be used
    Returns:
      the generated query

  - ### buildWhereClause

    public static void buildWhereClause(AbstractSqlPagingQueryProvider provider, boolean remainingPageQuery, StringBuilder sql)
    Generates WHERE clause for queries that require sub selects.
    Parameters:
      `provider` - the paging query provider that will provide the base where clause
      `remainingPageQuery` - if true assumes more will be appended to where clause
      `sql` - the sql statement to be appended.

  - ### buildSortClause

    public static String buildSortClause(AbstractSqlPagingQueryProvider provider)
    Generates ORDER BY attributes based on the sort keys.
    Parameters:
      `provider` - `AbstractSqlPagingQueryProvider` providing the implementation specifics
    Returns:
      a String that can be appended to an ORDER BY clause.

  - ### buildSortClause

    public static String buildSortClause(Map<String,org.springframework.batch.item.database.Order> sortKeys)
    Generates ORDER BY attributes based on the sort keys.
    Parameters:
      `sortKeys` - generates order by clause from map
    Returns:
      a String that can be appended to an ORDER BY clause.