![](https://img-blog.csdnimg.cn/20201014180756930.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
mybatis
mybatis小结
*小说家*
这个作者很懒,什么都没留下…
展开
-
mybatis中bean和数据库字段名字不一致解决方式
1、使用内置ConfigurationCustomizer编写配置类,修改Configuration中的mapUnderscoreToCamelCase属性为 true此时数据库字段和实体类字段不一致问题可以解决@Configurationpublic class MybatisConfig { @Bean public ConfigurationCustomizer customizer(){ return new ConfigurationCust..原创 2020-12-11 21:19:54 · 668 阅读 · 0 评论 -
mybatis常用的注解大全(持续更新)
mybatis常用的注解大全1、增删改查类的注解@Select@Delete@Insert@Update:@Options:能够设置缓存时间,能够为对象生成自增的key。第一种用法,用于插入数据:创建一个表CREATE TABLE person ( `pid` INT(20) NOT NULL AUTO_INCREMENT, `pname` VARCHAR(50) DEFAULT NULL, `addr` VARCHAR(50) DEFAULT NULL,原创 2020-12-03 22:10:03 · 7277 阅读 · 0 评论