mybatis There is no getter for property named 'xx' in 'class java.lang.String
转载自://http://www.cnblogs.com/anee/p/3324140.html
用mybatis查询时,传入一个字符串传参数,且进行判断时,会报
- There is no getter for property named 'moduleCode' in 'class java.lang.String
错误写法:
- <select id="queryAllParentModule" resultType="jobModule" parameterType="jobModule">
- select modulecode,
- modulename,
- modulevalue,
- linkurl,
- rank,
- parentmodule=isnull(parentmodule,1),
- moduledescription
- from job_module
- <where>
- <choose>
- <when test="moduleCode!=null and moduleCode!=''">modulecode = #{moduleCode}</when>
- <when test="moduleCode==null or moduleCode==''">(parentmodule is null or len(parentmodule)<=0)</when>
- </choose>
- </where>
- lt;/select>
需要修改成:
- <select id="queryModuleByCode" resultType="jobModule" parameterType="string">
- select modulecode,
- modulename,
- modulevalue,
- linkurl,
- rank,
- parentmodule=isnull(parentmodule,1),
- moduledescription
- from job_module
- <where>
- <choose>
- <when test="_parameter!=null and _parameter!=''">modulecode = #{_parameter}</when>
- <when test="_parameter==null or _parameter==''">(parentmodule is null or len(parentmodule)<=0)</when>
- </choose>
- </where>
- lt;/select>
不管你的参数是什么,都要改成"_parameter"
REFERENCES:http://txin0814.iteye.com/blog/1533645
---------------------------------------------------------------------------------------------------------------------------------
copyright:http://www.cnblogs.com/anee/
mybatis There is no getter for property named 'xx' in 'class java.lang.String的更多相关文章
- Mybatis问题:There is no getter for property named 'unitId' in 'class java.lang.String'
Mybatis遇到的问题 问题: org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.re ...
- 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 ...
- mybatis问题: There is no getter for property named 'equipmentId' in 'class java.lang.String'
本文来源于翁舒航的博客,点击即可跳转原文观看!!!(被转载或者拷贝走的内容可能缺失图片.视频等原文的内容) 若网站将链接屏蔽,可直接拷贝原文链接到地址栏跳转观看,原文链接:https://www.cn ...
- 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 ...
- Mybatis中传参包There is no getter for property named 'XXX' in 'class java.lang.String'
Mybatis中传参包There is no getter for property named 'XXX' in 'class java.lang.String' 一.发现问题 <select ...
- 【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 ...
- 已解决: mybatis报错 org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'xxx' in 'class java.lang.String'
最近在练习MyBatis时 进行姓名的模糊查询时候出现 org.apache.ibatis.exceptions.PersistenceException: ### Error querying da ...
- org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'socialCode' in 'class java.lang.String'
异常: org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.Refl ...
- Mybatis异常There is no getter for property named 'XXX' in 'class java.lang.String'
1.当入参为 string类型时 (包括java.lang.String.) 我们使用#{xxx}引入参数.会抛异常There is no getter for property named 'XX ...
随机推荐
- 【CF刷题】14-05-12
Round 236 div.1 A:只需要每个点连接所有比他大的点,知道边用完为止. //By BLADEVIL #include <cmath> #include <cstdio& ...
- hihocoder #1058 Combination Lock
传送门 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 Finally, you come to the interview room. You know that a ...
- 求DAG上两点的最短距离
Problem 给出一个不带边权(即边权为1)的有向无环图(unweighted DAG)以及DAG上两点s, t,求s到t的最短距离,如果无法从s走到t,则输出-1. Solution DFS,BF ...
- iOS 开发之内购 – AppStore
前言本文会给大家详细介绍iOS内购,虽然之前网上也有内购的教程,但是还不够详细,我重新整理出一份教程,希望对大家有所帮助. 基于Xcode7.1.1版本,模拟器iphone6,9.1系统. ...
- 求任意长度数组的最大值(整数类型)。利用params参数实现任意长度的改变。
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.T ...
- html input file标签的上传文件 注意点
文件上传框 代码格式:<input type=“file” name=“...” size=“15” input enctype="multipart/form-data“ maxl ...
- Unity自动打包Apk
unity打包apk相对来说比较容易,相信出过的人都明白,出包过程,没有大的难度,一步一操作,一步一等待,繁琐耗时,不懂的人又代替不了.这时候需求就来了,如何简单的一键打包搞定,这个就稍微有点难度,当 ...
- epoch iteration batchsize
深度学习中经常看到epoch. iteration和batchsize,下面按自己的理解说说这三个的区别: (1)batchsize:批大小.在深度学习中,一般采用SGD训练,即每次训练在训练集中取b ...
- 图片服务器和WEB应用服务器相分离的简单方案
只是简单说明一下原理,其它的自己探索吧:) 一.两个域名:www.domain.com和img.domain.com 二.在www域名的服务器中上传文件: up.html <form name= ...
- H2Database数据类型
数据类型 整数(INT) 布尔型(BOOLEAN) 微整数(TINYINT) 小整数(SMALLINT) 大整数(BIGINT) 标识符(IDENTITY) 货币数(DECIMAL) 双精度实数( ...