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 ...
随机推荐
- java--4种内部类
内部类: 一 非静态内部类 //非静态内部类 //非静态内部类可任意调用外部类的局部变量,无论是否private //在外部类中要实例化内部类:InnerClass inner = new Inner ...
- COGS502. 长路上的灯
502. 长路上的灯 ☆ 输入文件:light.in 输出文件:light.out 简单对比时间限制:1 s 内存限制:128 MB [题目描述] 在一条无限长的路上,有一排无限长的路 ...
- 15款开源PHP类库
PHP库给开发者提供了一个标准接口,它帮助开发者在PHP里充分利用面向对象编程.这些库为特定类型的内置功能提供了一个标准的API,允许类可以与PHP引擎进行无缝的交互.此外,开发者使用这些类库还可以简 ...
- JLINK使用教程详解,以及与JTAG区别
对于一个新手来说,一切都不容易. 而从头学起也是一件非常美好的事. 观看 调试ARM,要遵循ARM的调试接口协议,JTAG就是其中的一种.当仿真时,IAR.KEIL.ADS等都有一个公共的调试 ...
- [转载]单元测试之道(使用NUnit)
首先来看下面几个场景你是否熟悉 1.你正在开发一个系统,你不断地编码-编译-调试-编码-编译-调试……终于,你负责的功能模块从上到下全部完成且编译通过!你长出一口气,怀着激动而又忐忑的心情点击界面上的 ...
- 如何使用同一个Action中的不同方法
如何使用同一个Action中的不同方法 1.使用Action的DMI(Dynamic Method Invocation--动态方法调用) (1)动态方法调用: 表单元素的action不是直接为某个A ...
- #使用while循环输入1 2 3 4 5 6 8 9 10
#!/usr/bin/env python #使用while循环输入1 2 3 4 5 6 8 9 10 import time start = 1 while True: if start == 7 ...
- Spring MVC 详解(一)
springmvc是spring的一个模块,提供web层解决方案(基于mvc设计架构),mvc是一个设计模式,在b/s系统的应用: spring 的架构 mvc设计模式 spring MVC的框架 第 ...
- BZOJ 2661 连连看(费用流)
题目链接:http://61.187.179.132/JudgeOnline/problem.php?id=2661 题意:给出一个区间[a,b]中的全部整数,如果其中某两个数x,y(设x>y) ...
- require或include相对路径多层嵌套引发的问题
require或include相对路径多层嵌套引发的问题 php中require/include 包含相对路径的解决办法 在PHP中require,include一个文件时,大都是用相对路径,是个 ...