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.SqlDialectimplementation 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 classMongoBuilderDialect. - Inheritance Structure Reorganization: Logic has been pushed down to
AbstractSqlDialect, forming a clear hierarchy ofAbstractBuilderDialect->AbstractSqlDialect/MongoDialect.
- Dialect as Factory: Introduced
-
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.,
MongoBuildermisusingMySqlDialect).
- Unified API: Upper-layer calls no longer need to determine which Builder to instantiate based on database type; they uniformly use
-
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 fromAbstractSqlDialectand override thenewBuilder()method.