本文为博主原创,未经允许不得转载: resultMap标签是为了映射select查询出来结果的集合,其主要作用是将实体类中的字段与 数据库表中的字段进行关联映射. 注意:当实体类中的字段与数据库表中的字段相同时,可以将resultMap标签中的关联关系 忽略不写.当实体类中的字段与数据库表中的字段不相同时,就需要在resultMap标签中将实体类 字段与数据库字段一 一进行关联映射. 举例如下: 1.实体类代码: public class Test { private int id; priva
启动项目报错 2018-02-26 17:09:51,535 ERROR [org.springframework.web.context.ContextLoader] - Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'testTreeDao' defined in file [/Users/jds/Docu
resultType:直接表示返回类型 resultMap:对外部resultMap的引用 二者不能同时使用 创建一个实体类Role和User public class Role { private Integer id; private String roleCode; private String roleName; //省略set.get方法 创建User类(在User中有roleId 1对多关系) public class User { private Integer id; pri