-
Notifications
You must be signed in to change notification settings - Fork 211
Description
I would like to propose a few enhancements for MyBatis Dynamic SQL that could help reduce the redundancy and improve the maintainability of the generated code, especially in large-scale enterprise applications.
Direct Mapping between SqlColumn and Database Fields
It would be helpful if MyBatis Dynamic SQL could support direct mapping between SqlColumn objects and the corresponding database columns, eliminating the need for redundant string constants and manual mapping definitions for every field. This would reduce boilerplate code and improve the readability and maintainability of the generated code.
Reduction of Redundant Code in Support Classes
The generated support classes often contain a lot of repetitive code, particularly in the declaration of SqlColumn objects and the field mappings. A more elegant design could be implemented to minimize this redundancy, centralize reusable constants, and avoid unnecessary repetition in the generated code.
Centralized Maintenance of Unchanging Constants
In enterprise-level applications, the same strings (such as table names, column names, etc.) are repeated throughout the codebase. It would be great if MyBatis could provide a mechanism for centralizing and reusing these constants, which would not only simplify code but also reduce the overall size of the generated classes.
Reducing the Build Size
By eliminating redundancy and centralizing constants, the resulting generated code would be more compact. This can lead to smaller build sizes, which is especially valuable when compiling for native environments, where every byte counts.