org.springframework.cloud.dataflow.server.repository.support

## Class SqlPagingQueryUtils

- java.lang.Object
- - org.springframework.cloud.dataflow.server.repository.support.SqlPagingQueryUtils

-     public class SqlPagingQueryUtils
      extends Object

  Utility class that generates the actual SQL statements used by query providers.
  Author:
    Glenn Renfro

- - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static String` | `buildSortClause(AbstractSqlPagingQueryProvider provider)` Generates ORDER BY attributes based on the sort keys.
    `static String` | `buildSortClause(Map<String,Order> sortKeys)` 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
    `static String` | `generateTopSqlQuery(AbstractSqlPagingQueryProvider provider, boolean remainingPageQuery, 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 Detail

    - #### 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` - whether there is a page query
        `sql` - the sql to append the WHERE clause

    - #### generateTopSqlQuery

          public static String generateTopSqlQuery(AbstractSqlPagingQueryProvider provider,
                                                   boolean remainingPageQuery,
                                                   String topClause)

      Generate SQL query string using a TOP clause
      Parameters:
        `provider` - `AbstractSqlPagingQueryProvider` providing the implementation specifics
        `remainingPageQuery` - is this query for the remaining pages (true) as opposed to the first page (false)
        `topClause` - the implementation specific top clause to be used
      Returns:
        the generated query

    - #### 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,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.

Copyright © 2021 Pivotal Software, Inc.. All rights reserved.