Skip to content
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

关于 01.代码生成器新 文档的疑问 #320

Closed
Gabriel-1023 opened this issue Jun 4, 2023 · 1 comment
Closed

关于 01.代码生成器新 文档的疑问 #320

Gabriel-1023 opened this issue Jun 4, 2023 · 1 comment

Comments

@Gabriel-1023
Copy link

Gabriel-1023 commented Jun 4, 2023

Update 01.代码生成器新.md@qmdx 添加了如下代码:

 .dataSourceConfig(builder -> builder.typeConvertHandler((globalConfig, typeRegistry, metaInfo) -> {
        int typeCode = metaInfo.getJdbcType().TYPE_CODE;
        if (typeCode == Types.SMALLINT) {
            // 自定义类型转换
            return DbColumnType.INTEGER;
        }
        return typeRegistry.getColumnType(metaInfo);
    }))

dataSourceConfig 方法在 mybatis-plus 的 3.5.3.1 版本中,使用3.5.1、3.5.2、3.5.3版本,上述代码都会报错提示找不到该方法。

@qmdx
Copy link
Member

qmdx commented Jun 8, 2023

需要使用新版本代码生成器

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

3 participants