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 ...
随机推荐
- [theWord] 一种英文字典的基类设计
theWord --- 一种英文字典的基类设计 使用场景 想写一个应用,来记录自己背单词时候,对每个单词的记忆状况之类的东西.至于为什么做这个,试过了一些背单词软件,并不觉得好用,自己做一个吧. 那么 ...
- JS中的call()和apply()方法和bind()
1.方法定义 call方法: 语法:call([thisObj[,arg1[, arg2[, [,.argN]]]]]) 定义:调用一个对象的一个方法,以另一个对象替换当前对象. 说明: call ...
- css 中的position z-index em rem zoom 的基本用法
1.position定位: CSS 定位和浮动 CSS 为定位和浮动提供了一些属性,利用这些属性,可以建立列式布局,将布局的一部分与另一部分重叠,还可以完成多年来通常需要使用多个表格才能完成的任务. ...
- Android属性动画完全解析(中)
转载:http://blog.csdn.net/guolin_blog/article/details/43536355 大家好,在上一篇文章当中,我们学习了Android属性动画的基本用法,当然也是 ...
- c++中两种常量方法的比较
[c++]在C++中定义常量的两种方法的比较 常量是定以后,在程序运行中不能被改变的标识符.C++中定义常量可以用#define .const 这两种方法.例如: #define PRICE 10 ...
- Json 入门例子【3】
Javascript 和Jquery 通过ID 获取值. <script> var txt1 = [{ "CityId": 18, "CityName&quo ...
- MyBatis的返回参数类型和查询结果遍历
MyBatis的返回参数类型分两种 1. 对应的分类为: 1.1.resultMap: 1.2.resultType: 2 .对应返回值类型: 2.1.resultMap:结果集 2.2.result ...
- 拖拽碰撞效果,高级浏览器下全部搞定(ie6-8还没有搞定)
<!DOCTYPE HTML> <html lang="en-US"> <head> <meta charset="UTF-8& ...
- 一个js搜索功能的实现
这次的重点就在于一个兼容性的问题.就是innerText(微软ie)和textContent(火狐)的知识点,兼容性永远都是伤啊 <!DOCTYPE html PUBLIC "-//W ...
- mysql中bigint、int、mediumint、smallint 和 tinyint的取值范围
mysql数据库设计,其中,对于数据性能优化,字段类型考虑很重要,搜集了些资料,整理分享出来,这篇为有关mysql整型bigint.int.mediumint.smallint 和 tinyint的语 ...