Skip to content

Provide unified Column supporting both database column and entity property mapping in Dynamic SQL #964

@chastro3

Description

@chastro3

Currently, MyBatis Dynamic SQL generates SqlColumn fields that represent database columns but do not directly bind or link to entity property names. This causes a lot of duplication and boilerplate code, such as having to maintain separate mappings for database column names and entity field names (e.g., toProperty mappings) manually or via additional configurations.

Image

I’d like to suggest adding support for a unified Column (or enhanced SqlColumn) type that simultaneously holds:

the database column name,
the JDBC type,
and the corresponding entity property name.

This would simplify code generation and improve type-safety, reduce redundancy, and help maintain consistency between SQL building and entity mapping. The generated code would be cleaner, easier to maintain, and less error-prone.

Would you consider adding such a feature or making the code generation support this pattern in a future release?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    pFad - Phonifier reborn

    Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

    Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy