association ,collection
mybatis 出现这个错误
Error creating document instance. Cause: org.xml.sax.SAXParseException; lineNumber: 24; columnNumber: 17; 元素类型为 "resultMap" 的内容必须匹配 "(constructor?,id*,result*,association*,collection*,discriminator?)"
原因是 association ,collection 的出现必须按照(constructor?,id*,result*,association*,collection*,discriminator?)的先后顺序
<resultMap id="BaseResultMap" type="com.aixuexi.train.entity.Course">
<id column="ID" property="id" jdbcType="INTEGER"/>
<result column="SERIES_ID" property="seriesId" jdbcType="INTEGER"/>
<result column="NAME" property="name" jdbcType="VARCHAR"/>
<result column="STATUS" property="status" jdbcType="VARCHAR"/>
<result column="COURSE_TYPE" property="courseType" jdbcType="VARCHAR"/>
<result column="IMG_URL" property="imgUrl" jdbcType="VARCHAR"/>
<result column="START_TIME" property="startTime" jdbcType="TIMESTAMP"/>
<result column="END_TIME" property="endTime" jdbcType="TIMESTAMP"/>
<result column="CONDITIONS" property="conditions" jdbcType="VARCHAR"/>
<result column="SUIT" property="suit" jdbcType="VARCHAR"/>
<result column="INTRODUCE" property="introduce" jdbcType="LONGVARCHAR"/>
<association property="messageObject"
column="ID"
select="com.aixuexi.train.mapper.MessageObjectMapper.selectByPrimaryKey"/>
<collection property="lectruers"
ofType="com.aixuexi.train.entity.Lectruer"
column="id"
javaType="java.util.ArrayList"
select="com.aixuexi.train.mapper.CourseLectruerMapper.selectByCourseId"/>
</resultMap>
association ,collection的更多相关文章
- mybatis mapper association collection
1.Question Description: sometimes, POJO bean contains another bean or collection as property, it's s ...
- 解决 Mybatis 元素类型为 "resultMap" 的内容必须匹配 "(constructor?,id*,result*,association*,collection*,discriminat
在配置 mybatis mapper.xml文件时, 一不小心就会报如下类似的异常: Caused by: org.springframework.beans.factory.BeanCreation ...
- mybatis项目启动报错 The content of element type "resultMap" must match "(constructor?,id*,result*,association*,collection*,discriminator?)".
启动项目报错 2018-02-26 17:09:51,535 ERROR [org.springframework.web.context.ContextLoader] - Context initi ...
- Mybatis 高级结果映射 ResultMap Association Collection
在阅读本文章时,先说几个mybatis中容易混淆的地方: 1. mybatis中的列不是数据库里的列而是查询里的列,可以是别名(如 select user_name as userName,这时col ...
- 错误Mybatis 元素类型为 "resultMap" 的内容必须匹配 "(constructor?,id*,result*,association*,collection*,discriminat
今天算是见识了什么事顺序的重要性. 在使用mybatis时由于联合了其他的表,用到了resultMap,之后外加association这一项.可是在替换对应字段的位置上加上association总是报 ...
- mybatis学习(八)——resultMap之association&&collection解析
一.resultMap的使用 resultMap 也是定义返回值类型,返回值为用户自定义的类型,可用于解决JavaBean中的属性名和数据库中的列名不一致的情况 之前对于JavaBean中属性名和数据 ...
- Mybatis 元素类型为 "resultMap" 的内容必须匹配 "(constructor?,id*,result*,association*,collection*,discriminat
<resultMap id="BaseResultMap" type="com.youotech.tl_cons_credit_rating.entity.TL_C ...
- collection和association的区别于关系
比如同时有User.java和Card.java两个类 User.java如下: public class User{ private Card card_one; private List<C ...
- mybatis association和collection标签怎么用
<resultMap type="Bill" id="ResultBill"> <id property="id" col ...
随机推荐
- 反射获取类中的属性和set属性
package framework.base; import java.beans.IntrospectionException; import java.beans.PropertyDescript ...
- 2016 Al-Baath University Training Camp Contest-1 H
Description You've possibly heard about 'The Endless River'. However, if not, we are introducing it ...
- 2017年1月7日 星期六 --出埃及记 Exodus 21:33
2017年1月7日 星期六 --出埃及记 Exodus 21:33 "If a man uncovers a pit or digs one and fails to cover it an ...
- 2016年12月16日 星期五 --出埃及记 Exodus 21:11
2016年12月16日 星期五 --出埃及记 Exodus 21:11 If he does not provide her with these three things, she is to go ...
- 2016年12月11日 星期日 --出埃及记 Exodus 21:6
2016年12月11日 星期日 --出埃及记 Exodus 21:6 then his master must take him before the judges. He shall take hi ...
- spark记录
Filtering multiple values in multiple columns: In the case where you're pulling data from a database ...
- winform打包关键部分
- win7下如何安装JDK
第一步:点击下载好的JDK安装程序,百度一下,网上很多,然后弹出如下界面,点击“下一步”即可. 2 第二步:此时比较关键,设置安装的路径,可以事先建立一个文件夹,以在D盘为例,如D:\java. 3 ...
- Python 字符串、元组、字典转换成列表
- UVA 1351 十三 String Compression
String Compression Time Limit:3000MS Memory Limit:0KB 64bit IO Format:%lld & %llu Submit ...