Class OffsetFetchQueryRewriter

    • Constructor Detail

      • OffsetFetchQueryRewriter

        public OffsetFetchQueryRewriter​(JdbcDataContext dataContext,
                                        int minSupportedVersion,
                                        boolean fetchNeedsOrderBy)
    • Method Detail

      • isFirstRowSupported

        public boolean isFirstRowSupported​(org.apache.metamodel.query.Query query)
        Description copied from interface: IQueryRewriter
        Gets whether this query rewriter is able to write the "First row" query property to the query string.
        Specified by:
        isFirstRowSupported in interface IQueryRewriter
        Overrides:
        isFirstRowSupported in class DefaultQueryRewriter
        Parameters:
        query - For some database engines, the content of the query decides the ability to change first row
        Returns:
        whether this query rewriter is able to write the "First row" query property to the query string.
      • isMaxRowsSupported

        public boolean isMaxRowsSupported()
        Description copied from interface: IQueryRewriter
        Gets whether this query rewriter is able to write the "Max rows" query property to the query string.
        Specified by:
        isMaxRowsSupported in interface IQueryRewriter
        Overrides:
        isMaxRowsSupported in class DefaultQueryRewriter
        Returns:
        whether this query rewriter is able to write the "Max rows" query property to the query string.
      • rewriteQuery

        public String rewriteQuery​(org.apache.metamodel.query.Query query)
        If the Max rows and First row property of the query is set, then we will use the database's "OFFSET i ROWS FETCH NEXT j ROWS ONLY" construct.
        Specified by:
        rewriteQuery in interface IQueryRewriter
        Overrides:
        rewriteQuery in class AbstractQueryRewriter