随笔分类 - mapper
mapper的一些东西
摘要:insert中的 parameterType="SchClass" useGeneratedKeys="true" keyProperty="classId" 用来获取添加数据的id的,将添加成功的数据的id给SchClass类中的 classId. 点击查看代码 <insert id="inser
阅读全文
摘要:mapper.xml的一些配置: parameterType: 请求的参数类型: resultMap:也是结果集映射 resultType:这个是查询的结果映射到那个实体:就相当于不用写resulMap,但是实体类的属性名字要和数据库中表的字段一样。 不用springboot 注解获取mapper映
阅读全文
摘要:mapper的一些标签用法: sql和include; sql标签里面定义代码片段,include使用指定的代码片段。 点击查看代码 <sql id="select">select * from</sql> <select> <include rdfid="select" user></includ
阅读全文