Mybatis
玉带林中挂
这个作者很懒,什么都没留下…
展开
-
A component required a bean of type ‘com.dmsd.omo.xxt2.mapper.ComScoreMapper‘ that could not be foun
A component required a bean of type 'com.dmsd.omo.xxt2.mapper.ComScoreMapper' that could not be found.报错原因:1、查看是否引入@Controller、@Mapper、@Service等生成bean的注解2、查看引入的注解是否正确:如上图存在两个重名的Mapper注解,我们用的是上面这个。类似的重名注解(Param)还存在Mapper层中:注意选择正确的注解。...原创 2020-11-18 21:15:44 · 3029 阅读 · 8 评论 -
Mybatis总结
一、Mybatis主配置文件1、连接数据库:<environments default="mysql"><!-- 配置mysql的环境--> <environment id = "mysql"><!-- 配置事务--> <transactionManager type = "JDBC"></transactionManager><!--..原创 2020-08-15 14:40:54 · 365 阅读 · 1 评论 -
mybatis 配置+模糊查询
使用mybatis连接mysql的话,需要如下步骤:1、生成实体类。public class User implements Serializable { private Integer id; private String username; private String address; private String sex; private Date birthday;//没有使用lombok,下面有get和set方法}2、生成主配置文件,放原创 2020-08-11 17:20:58 · 337 阅读 · 2 评论