Interface SqlFromToPlugin

  • All Superinterfaces:
    Modifiers
    All Known Implementing Classes:
    DefaultSqlPlugins

    public interface SqlFromToPlugin
    extends Modifiers
    The SQL Processor plugin devoted to the FROM-TO SQL construction. The primary usage is to support the pagination. There are utilized the patterns from the SqlFeature. These pattern have to be combined with the original SQL query, the limit and the offset in the next way:
    • $S is the full original query
    • $s is the original query without the token select
    • $F is 1-based from rowid (=offset)
    • $f is 0-based from rowid (offset)
    • $M is the max number of returned rows
    • $m is the max rowid of returned rows
    Author:
    Vladimir Hudec
    • Method Detail

      • limitQuery

        SqlFromToPlugin.LimitType limitQuery​(SqlRuntimeContext runtimeCtx,
                                             String queryString,
                                             StringBuilder queryResult,
                                             Integer firstResult,
                                             Integer maxResults,
                                             boolean ordered)
        Used to construct the FROM-TO SQL.
        Parameters:
        runtimeCtx - the public runtime context
        queryString - the original ANSI SQL
        queryResult - the final ANSI SQL reflected FROM and TO restrictions
        firstResult - The first SQL execution output row to be returned in the case we need to skip some rows in the result set. The primary usage is to support the pagination.
        maxResults - The max number of SQL execution output rows, which can be returned in the result list. The primary usage is to support the pagination.
        ordered - the SQL output is sorted
        Returns:
        the characteristic of FROM and TO restrictions used in SqlQuery.list(SqlRuntimeContext)