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

mybatis plus 公共参数 MetaObjectHandler 不生效 #13

Open
zoeminghong opened this issue Aug 19, 2020 · 1 comment
Open

mybatis plus 公共参数 MetaObjectHandler 不生效 #13

zoeminghong opened this issue Aug 19, 2020 · 1 comment
Labels

Comments

@zoeminghong
Copy link
Owner

zoeminghong commented Aug 19, 2020

描述:

自己声明 MetaObjectHandler 实现类,并 @component 进行加载,但在使用的时候,没有进入类方法中。查询了网络上的文章和检查官方文档内容,觉得自己代码并没有问题。通过关键字在github mybatis plus 项目中找到了一些实现类,定位到了 MybatisDefaultParameterHandler类,发现 populateKeys 方法中 metaObjectHandler 为 null 。说明我的 MetaObjectHandler 未被加载进去。尝试手动加载方式,也不生效。当想要去找 Configuration 类进行debug 的时候,发现 boot starter 包并没有显示引用。进行该包的显式引用,问题解决了

方案:

显示引用

        <dependency>
            <groupId>com.baomidou</groupId>
            <artifactId>mybatis-plus-boot-starter</artifactId>
        </dependency>

参考文档:

https://blog.csdn.net/qq_25940921/article/details/88527773

@zoeminghong
Copy link
Owner Author

#12

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

No branches or pull requests

1 participant