java.lang.Object
org.miaixz.bus.pager.dialect.AbstractDialect
org.miaixz.bus.pager.dialect.AbstractPaging
org.miaixz.bus.pager.dialect.base.SqlServer
org.miaixz.bus.pager.dialect.base.SqlServer2012
- All Implemented Interfaces:
Dialect
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
-
Field Summary
Fields inherited from class org.miaixz.bus.pager.dialect.base.SqlServer
CACHE_COUNTSQL, CACHE_PAGESQL, replaceSql, sqlServerSqlParserFields inherited from class org.miaixz.bus.pager.dialect.AbstractPaging
PAGEPARAMETER_FIRST, PAGEPARAMETER_SECOND, SUFFIX_COUNT, SUFFIX_PAGEFields inherited from class org.miaixz.bus.pager.dialect.AbstractDialect
countSqlParser, orderBySqlParser -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetPageSql(String sql, Page page, org.apache.ibatis.cache.CacheKey pageKey) Generates the SQL Server 2012-specific pagination SQL.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.Methods inherited from class org.miaixz.bus.pager.dialect.base.SqlServer
getCountSql, getPageSql, setPropertiesMethods inherited from class org.miaixz.bus.pager.dialect.AbstractPaging
afterAll, afterCount, afterPage, beforeCount, beforePage, getLocalPage, handleParameter, processParameterObject, skipMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.miaixz.bus.pager.Dialect
asyncCountTask, isAsyncCount
-
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 addsPAGEPARAMETER_FIRST(offset) andPAGEPARAMETER_SECOND(limit) to the parameter map and updates theCacheKey.- Overrides:
processPageParameterin classSqlServer- Parameters:
ms- the MappedStatement objectparamMap- a map containing the query parameterspage- thePageobject containing pagination detailsboundSql- the BoundSql object for the querypageKey- the CacheKey for the paginated query- Returns:
- the processed parameter map
-
getPageSql
Generates the SQL Server 2012-specific pagination SQL. It appendsOFFSET ? ROWS FETCH NEXT ? ROWS ONLYto the original SQL.- Overrides:
getPageSqlin classSqlServer- Parameters:
sql- the original SQL stringpage- thePageobject containing pagination detailspageKey- the CacheKey for the paginated query- Returns:
- the SQL Server 2012-specific paginated SQL string
-