baomidou / mybatis-plus-doc

MyBatis-Plus Official Documentation

Home Page:https://baomidou.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

Gabriel-1023 opened this issue · comments

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版本,上述代码都会报错提示找不到该方法。

commented

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