Module bus.pager

Class SqlServer2012

All Implemented Interfaces:
Dialect

public class SqlServer2012 extends SqlServer
Database dialect for SQL Server 2012 and later versions. This class extends SqlServer to provide specific implementations for pagination SQL generation using `OFFSET ... ROWS FETCH NEXT ... ROWS ONLY` syntax.
Since:
Java 17+
Author:
Kimi Liu
  • Constructor Details

    • SqlServer2012

      public SqlServer2012()
  • Method Details

    • processPageParameter

      public Object processPageParameter(org.apache.ibatis.mapping.MappedStatement ms, Map<String,Object> paramMap, Page page, org.apache.ibatis.mapping.BoundSql boundSql, org.apache.ibatis.cache.CacheKey pageKey)
      Processes the pagination parameters for SQL Server 2012. It adds PAGEPARAMETER_FIRST (offset) and PAGEPARAMETER_SECOND (limit) to the parameter map and updates the CacheKey.
      Overrides:
      processPageParameter in class SqlServer
      Parameters:
      ms - the MappedStatement object
      paramMap - a map containing the query parameters
      page - the Page object containing pagination details
      boundSql - the BoundSql object for the query
      pageKey - the CacheKey for the paginated query
      Returns:
      the processed parameter map
    • getPageSql

      public String getPageSql(String sql, Page page, org.apache.ibatis.cache.CacheKey pageKey)
      Generates the SQL Server 2012-specific pagination SQL. It appends OFFSET ? ROWS FETCH NEXT ? ROWS ONLY to the original SQL.
      Overrides:
      getPageSql in class SqlServer
      Parameters:
      sql - the original SQL string
      page - the Page object containing pagination details
      pageKey - the CacheKey for the paginated query
      Returns:
      the SQL Server 2012-specific paginated SQL string