Skip to main content

v6.5.0 (2026-01-15)

Hint

This article is generated by AI translation.

<dependency>
<groupId>net.hasor</groupId>
<artifactId>dbvisitor</artifactId>
<version>6.5.0</version>
</dependency>

This version focuses on a major architectural refactoring of the underlying Dialect system. It highly coheres "dialect metadata" with "command building capabilities," resolving the abstraction fragmentation issues present in the old architecture.

Impact Scope

  • Dialect system (Dialect/Builder) and its inheritance hierarchy
  • Custom dialect extension APIs

What's New

  • Refactoring

    • Dialect as Factory: Introduced newBuilder() factory method. SqlDialect implementation classes now are responsible for producing corresponding builder instances.
    • Prototype Pattern Application: Dialect implementation classes now have a dual identity, serving as both stateless metadata singletons and stateful builder prototypes.
    • Class Hierarchy Simplification: Completely removed independent SqlCommandBuilder, MongoCommandBuilder, and the glue class MongoBuilderDialect.
    • Inheritance Structure Reorganization: Logic has been pushed down to AbstractSqlDialect, forming a clear hierarchy of AbstractBuilderDialect -> AbstractSqlDialect / MongoDialect.
  • Optimizations

    • Unified API: Upper-layer calls no longer need to determine which Builder to instantiate based on database type; they uniformly use dialect.newBuilder().
    • Cohesion Improvement: Database-specific metadata (like keywords) and construction logic (like SQL generation) are converged within the same dialect class.
    • Type Safety: Eliminated runtime risks of mismatch between builders and dialect instances (e.g., MongoBuilder misusing MySqlDialect).
  • Compatibility Notes

    • This refactoring is transparent to general users, and the API remains backward compatible.
    • Upgrade Note: If you have implemented a custom Dialect and relied on the old SqlCommandBuilder, please change to inherit from AbstractSqlDialect and override the newBuilder() method.