Module bus.pager

Class AbstractDialect

java.lang.Object
org.miaixz.bus.pager.dialect.AbstractDialect
All Implemented Interfaces:
Dialect
Direct Known Subclasses:
AbstractPaging, AbstractRowBounds

public abstract class AbstractDialect extends Object implements Dialect
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 Details

    • countSqlParser

      protected CountSqlParser countSqlParser
      The SQL parser for generating count queries.
    • orderBySqlParser

      protected OrderBySqlParser 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:
      getCountSql in interface Dialect
      Parameters:
      ms - the MappedStatement object
      boundSql - the BoundSql object containing the original SQL and parameters
      parameterObject - the parameter object for the query
      rowBounds - the RowBounds object containing pagination parameters
      countKey - the CacheKey for the count query
      Returns:
      the generated count SQL string
    • setProperties

      public void setProperties(Properties properties)
      Sets the properties for the dialect, initializing the CountSqlParser and OrderBySqlParser. Custom implementations of these parsers can be specified via properties.
      Specified by:
      setProperties in interface Dialect
      Parameters:
      properties - the properties to set, typically from the plugin configuration