Module bus.pager

Class Defalut

java.lang.Object
org.miaixz.bus.pager.dialect.auto.Defalut
All Implemented Interfaces:
AutoDialect<String>

public class Defalut extends Object implements AutoDialect<String>
Default auto-dialect implementation that iterates through all registered AbstractAutoDialect implementations to find a matching one. If no specific match is found, it falls back to the Early dialect.
Since:
Java 17+
Author:
Kimi Liu
  • Constructor Details

    • Defalut

      public Defalut()
  • Method Details

    • registerAutoDialect

      public static void registerAutoDialect(AbstractAutoDialect autoDialect)
      Allows manual registration of additional AbstractAutoDialect implementations. This is generally not necessary as common ones are auto-detected.
      Parameters:
      autoDialect - the AbstractAutoDialect instance to register
    • extractDialectKey

      public String extractDialectKey(org.apache.ibatis.mapping.MappedStatement ms, DataSource dataSource, Properties properties)
      Extracts the dialect key (JDBC URL) by iterating through registered auto-dialects. If a match is found, it's cached and returned. Otherwise, it falls back to Early.DEFAULT.
      Specified by:
      extractDialectKey in interface AutoDialect<String>
      Parameters:
      ms - the MappedStatement being executed
      dataSource - the DataSource associated with the MappedStatement
      properties - the configuration properties
      Returns:
      the dialect key (JDBC URL) for the detected dialect
    • extractDialect

      public AbstractPaging extractDialect(String dialectKey, org.apache.ibatis.mapping.MappedStatement ms, DataSource dataSource, Properties properties)
      Extracts and returns the appropriate AbstractPaging dialect based on the dialect key. It uses the cached auto-dialect if available, otherwise falls back to Early.DEFAULT.
      Specified by:
      extractDialect in interface AutoDialect<String>
      Parameters:
      dialectKey - the dialect key (JDBC URL)
      ms - the MappedStatement being executed
      dataSource - the DataSource associated with the MappedStatement
      properties - the configuration properties
      Returns:
      an instance of AbstractPaging representing the determined dialect