java.lang.Object
org.miaixz.bus.pager.dialect.AbstractDialect
- All Implemented Interfaces:
Dialect
- Direct Known Subclasses:
AbstractPaging,AbstractRowBounds
Abstract base class for database dialects, providing common functionality for SQL parsing. This class integrates
CountSqlParser for intelligent count queries and OrderBySqlParser for order by clause handling.- Since:
- Java 17+
- Author:
- Kimi Liu
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CountSqlParserThe SQL parser for generating count queries.protected OrderBySqlParserThe SQL parser for handling order by clauses. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetCountSql(org.apache.ibatis.mapping.MappedStatement ms, org.apache.ibatis.mapping.BoundSql boundSql, Object parameterObject, org.apache.ibatis.session.RowBounds rowBounds, org.apache.ibatis.cache.CacheKey countKey) Generates the SQL for the count query using an intelligent SQL parser.voidsetProperties(Properties properties) Sets the properties for the dialect, initializing theCountSqlParserandOrderBySqlParser.Methods 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
afterAll, afterCount, afterPage, asyncCountTask, beforeCount, beforePage, getPageSql, isAsyncCount, processParameterObject, skip
-
Field Details
-
countSqlParser
The SQL parser for generating count queries. -
orderBySqlParser
The SQL parser for handling order by clauses.
-
-
Constructor Details
-
AbstractDialect
public AbstractDialect()
-
-
Method Details
-
getCountSql
public String getCountSql(org.apache.ibatis.mapping.MappedStatement ms, org.apache.ibatis.mapping.BoundSql boundSql, Object parameterObject, org.apache.ibatis.session.RowBounds rowBounds, org.apache.ibatis.cache.CacheKey countKey) Generates the SQL for the count query using an intelligent SQL parser.- Specified by:
getCountSqlin interfaceDialect- Parameters:
ms- the MappedStatement objectboundSql- the BoundSql object containing the original SQL and parametersparameterObject- the parameter object for the queryrowBounds- the RowBounds object containing pagination parameterscountKey- the CacheKey for the count query- Returns:
- the generated count SQL string
-
setProperties
Sets the properties for the dialect, initializing theCountSqlParserandOrderBySqlParser. Custom implementations of these parsers can be specified via properties.- Specified by:
setPropertiesin interfaceDialect- Parameters:
properties- the properties to set, typically from the plugin configuration
-