Class SybaseASE157LimitHandler

  • All Implemented Interfaces:

    public class SybaseASE157LimitHandler
    extends AbstractLimitHandler
    This limit handler is very conservative and is only triggered in simple cases involving a select or select distinct.

    Note that if the query already contains "top" just after the select or select distinct, we don't add anything to the query. It might just be a column name but, in any case, we just don't add the top clause and default to the previous behavior so it's not an issue.

    • Constructor Detail

      • SybaseASE157LimitHandler

        public SybaseASE157LimitHandler()
    • Method Detail

      • processSql

        public java.lang.String processSql​(java.lang.String sql,
                                           RowSelection selection)
        Description copied from interface: LimitHandler
        Return processed SQL query.
        Specified by:
        processSql in interface LimitHandler
        processSql in class AbstractLimitHandler
        sql - the SQL query to process.
        selection - the selection criteria for rows.
        Query statement with LIMIT clause applied.
      • useMaxForLimit

        public boolean useMaxForLimit()
        Description copied from class: AbstractLimitHandler
        Does the LIMIT clause take a "maximum" row number instead of a total number of returned rows?

        This is easiest understood via an example. Consider you have a table with 20 rows, but you only want to retrieve rows number 11 through 20. Generally, a limit with offset would say that the offset = 11 and the limit = 10 (we only want 10 rows at a time); this is specifying the total number of returned rows. Some dialects require that we instead specify offset = 11 and limit = 20, where 20 is the "last" row we want relative to offset (i.e. total number of rows = 20 - 11 = 9)

        So essentially, is limit relative from offset? Or is limit absolute?

        useMaxForLimit in class AbstractLimitHandler
        True if limit is relative from offset; false otherwise.
      • supportsVariableLimit

        public boolean supportsVariableLimit()
        Description copied from class: AbstractLimitHandler
        Does this handler support bind variables (i.e., prepared statement parameters) for its limit/offset?
        supportsVariableLimit in class AbstractLimitHandler
        True if bind variables can be used; false otherwise.