java.lang.Object
org.miaixz.bus.pager.dialect.auto.Defalut
- All Implemented Interfaces:
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionextractDialect(String dialectKey, org.apache.ibatis.mapping.MappedStatement ms, DataSource dataSource, Properties properties) Extracts and returns the appropriateAbstractPagingdialect based on the dialect key.extractDialectKey(org.apache.ibatis.mapping.MappedStatement ms, DataSource dataSource, Properties properties) Extracts the dialect key (JDBC URL) by iterating through registered auto-dialects.static voidregisterAutoDialect(AbstractAutoDialect autoDialect) Allows manual registration of additionalAbstractAutoDialectimplementations.
-
Constructor Details
-
Defalut
public Defalut()
-
-
Method Details
-
registerAutoDialect
Allows manual registration of additionalAbstractAutoDialectimplementations. This is generally not necessary as common ones are auto-detected.- Parameters:
autoDialect- theAbstractAutoDialectinstance 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 toEarly.DEFAULT.- Specified by:
extractDialectKeyin interfaceAutoDialect<String>- Parameters:
ms- the MappedStatement being executeddataSource- the DataSource associated with the MappedStatementproperties- 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 appropriateAbstractPagingdialect based on the dialect key. It uses the cached auto-dialect if available, otherwise falls back toEarly.DEFAULT.- Specified by:
extractDialectin interfaceAutoDialect<String>- Parameters:
dialectKey- the dialect key (JDBC URL)ms- the MappedStatement being executeddataSource- the DataSource associated with the MappedStatementproperties- the configuration properties- Returns:
- an instance of
AbstractPagingrepresenting the determined dialect
-