![](https://img-blog.csdnimg.cn/20201014180756918.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
mybatis
lx6766
这个作者很懒,什么都没留下…
展开
-
springboot mybatis sql打印日志
1 logback.xmljava dao,配置logger,debug <logger name="com.xx1.dao.xx2" level="DEBUG"/>2 mybatis-config.xml ,我用的logImpl为slf4j原创 2021-04-12 19:20:45 · 182 阅读 · 0 评论 -
从mybatis到mybatis plus(mp)
今天读到一个博客,是介绍mp的,它是mybatis的增强工具。只增强不改变。在使用时,只需要把原依赖替换为mp的即可1 那它的出现,有什么好处?相比于mybatis的sql灵活性,是相对的。即便一个简单的单表crud,都要自定义sql。为了简化这里的操作,mybatis引入了mp,针对单表的crud,引入像jpa这样的自动配置实现。推荐学习博客:https://www.jianshu.com/p/ceb1df475021https://www.jianshu.com/p/a4d5d31.原创 2020-06-24 16:26:20 · 972 阅读 · 0 评论 -
如何快速提取mybatis mapper里的sql语句
1 笨点,就是直接粘贴,手动去掉里面的判断语法2 调用SqlSessionTemplate的方法import org.mybatis.spring.SqlSessionTemplate; String sql= sqlsessionTemplate.getConfiguration().getMappedStatement("com.test.TestMapper.selectByP...原创 2019-11-13 11:40:08 · 3463 阅读 · 1 评论 -
mybatis数据库环境配置
mybatis-conf.xml<environment id="productmilk"> <transactionManager type="JDBC"/> <dataSource type="POOLED"> <property name="driver原创 2019-02-25 14:03:53 · 465 阅读 · 0 评论 -
mybatis批量更新问题
1 url路径中 参数连接符写& not & 批更新时报错2 update xx1 set a=x1,b=x2 where c=x3原创 2019-06-17 18:36:28 · 218 阅读 · 0 评论 -
mybatis新增返回主键
1方式一 注意返回的主键在入参对象的指定字段上 <insert id="insertSelective" parameterType="com.xxx.Tag"> <selectKey resultType="Integer" keyProperty="id" order="AFTER"> select @@IDENTI...原创 2019-09-26 18:44:43 · 130 阅读 · 0 评论 -
BindingException: Invalid bound statement (not found): com.ultimate.dao.LanguagetypeInfoMapper.xxx
做junit测试时,运行mapper方法时抛出此错误,意思是没有将interface xxMapper.java和mapper.xml文件关联上这里xml文件的namespace写错了<mapper namespace="xx.xx.aaMapper"></mapper>...原创 2019-09-27 17:12:32 · 137 阅读 · 0 评论 -
mybatis配置别名type-aliases-package,不能使用通配符,只能逐个包路径逗号分隔
#实体类的包路径#mybatis.type-aliases-package=com.ultimate.model.* 不可以使用通配符mybatis.type-aliases-package=com.ultimate.model.dto,com.ultimate.model.bo,com.ultimate.model.entity,com.ultimate.model.vo后面...原创 2019-09-27 19:20:08 · 13925 阅读 · 0 评论