从上面异常的解释来看是因为反射不能将Orders设置到orderdetails属性上,仔细检查了MyBatis的配置文件,发现:

 <collection property="orderdetails" javaType="com.luchao.mybatis.first.po.Orderdetail">
<result column="id" property="id"/>
<result column="items_id" property="itemsId"/>
<result column="items_num" property="itemsNum"/>
<result column="orders_id" property="ordersId"/>
</collection>

上面的javaType属性的问题,因为这个是一对多,通过反射应该映射为List,但是使用javaType会让MyBatis认为orderdetails属性为Orderdetail,所以出错,将javaType改为ofType,只是指定泛型的类型为Orderdetail。

Cause: org.apache.ibatis.reflection.ReflectionException: Could not set property 'orderdetails' of 'class com.luchao.mybatis.first.po.Orders' with value 'Orderdetail [id=null, ordersId=3, itemsId=1, it的更多相关文章

  1. org.apache.ibatis.reflection.ReflectionException

    org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.Reflecti ...

  2. Caused by: org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'zoneId' in 'class java.lang.String'

    本文为博主原创,未经允许不得而转载: 异常展示: dao层定义的接口为: public int getClientTotal(); 在mybatis中的sql为: <select id=&quo ...

  3. org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'list' in 'c

     org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'list' in ' ...

  4. org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'parentId' in 'class java.lang.String'

    Caused by: org.apache.ibatis.reflection.ReflectionException: There is no getter for property named ' ...

  5. mybatis之org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'time' in 'class java.lang.String'

    mybatis接口 List<String> getUsedCate(String time); 配置文件 <select id="getUsedCate" pa ...

  6. Mybatis笔记四:nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'id' in 'class java.lang.String'

    错误异常:nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for pr ...

  7. Caused by: org.apache.ibatis.reflection.ReflectionException我碰到的情况,原因不唯一

    映射文件: <select id="selectKeyByUserId"  resultMap="Xxx">        <![CDATA[ ...

  8. Caused by: org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'company' in 'class java.lang.String'

    Caused by: org.apache.ibatis.reflection.ReflectionException: There is no getter for property named ' ...

  9. 【Mybatis】mybatis查询报错org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'areaName' in 'class java.lang.String'

    mybatis查询报错: Caused by: org.apache.ibatis.reflection.ReflectionException: There is no getter for pro ...

随机推荐

  1. Linux内核源码树建立加载hello模块

    在加载模块之前,书中说要先建立内核源码树,那么,如何建立内核源码树呢? 首先,要先知道你的OS的内核版本,用uname -r可以查得到 在/url/src/目录下可以看到对应的版本目录 如果没有可以用 ...

  2. .Net程序员之Python基础教程学习----函数和异常处理[Fifth Day]

       今天主要记录,Python中函数的使用以及异常处理. 一.函数:    1.函数的创建以及调用. def Add(val1,val2): return val1+val2; print Add( ...

  3. 2015 Selenium大会

    9月8号到10号三天在俄勒冈州的波特兰召开了Selenium Conference 2015,分享的演讲很多,视频也放出来了,做了下搬运工,传到优酷 简介: A conference that bri ...

  4. Javascript的DOM操作 - 你真的了解吗?

    摘要 想稍微系统的说说对于DOM的操作,把Javascript和jQuery常用操作DOM的内容归纳成思维导图方便阅读,同时加入性能上的一些问题. 前言 在前端开发的过程中,javascript极为重 ...

  5. Codevs1378选课[树形DP|两种做法(多叉转二叉|树形DP+分组背包)---(▼皿▼#)----^___^]

    题目描述 Description 学校实行学分制.每门的必修课都有固定的学分,同时还必须获得相应的选修课程学分.学校开设了N(N<300)门的选修课程,每个学生可选课程的数量M是给定的.学生选修 ...

  6. [No000055]教你早晨清肠、除口臭、色斑、大肚腩

    [长生不老的秘诀] 释.道.医三家有个共同的秘诀:"要叫人不死. 肠中须无屎". 佛家除要求人们戒杀吃素外,还认为早饭是天食,中饭是人食,晚饭是鬼食. 因此,为了身体健康,不妨碍修 ...

  7. mysql--测试前缀索引能否用于order by 或者 group by

    创建一个测试用表 mysql> desc two; +-------+-------------+------+-----+---------+----------------+ | Field ...

  8. Symbol ES6 新增的一种值类型数据,表示一种绝不重复的值

    let s1 = Symbol(33); let s2 = Symbol(33); alert(typeof(s1)); //数据类型判断 // alert(s1.toString()); //可把一 ...

  9. mac系统使用内置的 PHP

    从 OS X 10.0.0 版本开始,PHP 作为 Mac 机的标准配置被提供.在默认的 web 服务器中启用 PHP,只需将 Apache 配置文件 httpd.conf 中的几行配置指令最前面的注 ...

  10. java多线程系类:基础篇:03Thread中的start()和run()的区别

    这个系类的内容全部来源于http://www.cnblogs.com/skywang12345/p/3479024.html.特别在此声明!!! 概要 Thread类包含start()和run()方法 ...