【摘要】 改造分层设计
Controller + Service + DAOController –> Service -> ServiceImpl -> DAO -> sprintboot.application.properties -> Mybatis xml file -> namespace 指定的sql
DAO 层只负责数据库增删改查
具体业务逻辑 在Ser…
改造分层设计
Controller + Service + DAO
Controller –> Service -> ServiceImpl -> DAO -> sprintboot.application.properties -> Mybatis xml file -> namespace 指定的sql
DAO 层只负责数据库增删改查
具体业务逻辑 在ServiceImpl 层以及Mybatis xml sql 里定义
注意:resources/mapper 目录下的UserDao.xml 文件名需要在 application.properties 需要配置 mybatis.mapper-locations=classpath:mapper/*Dao.xml
否则会有 org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)问题
最终项目结构如下:
本系列文章 参考学习作者 软件测试架构师俱乐部https://mp.weixin.qq.com/s/9lcUIvDS3qNqiFnZqE4rRA
文章来源: blog.csdn.net,作者:rookiesx,版权归原作者所有,如需转载,请联系作者。
原文链接:blog.csdn.net/rookiesx/article/details/115833174