Skip to content

Suggestions on DynamicSqlSupport #1225

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mailingfeng opened this issue Aug 16, 2024 · 1 comment
Closed

Suggestions on DynamicSqlSupport #1225

mailingfeng opened this issue Aug 16, 2024 · 1 comment

Comments

@mailingfeng
Copy link

Version: 1.4.2

Suggestion

table name as static variable,which can be used in other scenarios

// Now
public final class CorpDynamicSqlSupport {

    @Generated("org.mybatis.generator.api.MyBatisGenerator")
    public static final class Corp extends AliasableSqlTable<Corp> {
        public final SqlColumn<String> corpId = column("corp_id", JDBCType.VARCHAR);

        public ScheduleCorpConfigItem() {
            super("corp", ScheduleCorpConfigItem::new);
        }
   }
}

// Suggestion Change
public final class CorpDynamicSqlSupport {
    // !!!
    public static final String TABLE_NAME = "corp";

    @Generated("org.mybatis.generator.api.MyBatisGenerator")
    public static final class Corp extends AliasableSqlTable<Corp> {
        public final SqlColumn<String> corpId = column("corp_id", JDBCType.VARCHAR);

        public ScheduleCorpConfigItem() {
            super(TABLE_NAME, ScheduleCorpConfigItem::new);
        }
   }
}
@jeffgbutler
Copy link
Member

You could add the TABLE_NAME field with a plugin if it would be useful to you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants