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 'parentId' in 'class java.lang.String'
at org.apache.ibatis.reflection.Reflector.getGetInvoker(Reflector.java:)
at org.apache.ibatis.reflection.MetaClass.getGetInvoker(MetaClass.java:)
at org.apache.ibatis.reflection.wrapper.BeanWrapper.getBeanProperty(BeanWrapper.java:)
at org.apache.ibatis.reflection.wrapper.BeanWrapper.get(BeanWrapper.java:)
at org.apache.ibatis.reflection.MetaObject.getValue(MetaObject.java:)
at org.apache.ibatis.builder.xml.dynamic.DynamicContext$ContextMap.get(DynamicContext.java:)
at org.apache.ibatis.builder.xml.dynamic.DynamicContext$ContextAccessor.getProperty(DynamicContext.java:)
at org.apache.ibatis.ognl.OgnlRuntime.getProperty(OgnlRuntime.java:)
at org.apache.ibatis.ognl.ASTProperty.getValueBody(ASTProperty.java:)
at org.apache.ibatis.ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:)
at org.apache.ibatis.ognl.SimpleNode.getValue(SimpleNode.java:)
at org.apache.ibatis.ognl.ASTNotEq.getValueBody(ASTNotEq.java:)
at org.apache.ibatis.ognl.SimpleNode.evaluateGetValueBody(SimpleNode.java:)
at org.apache.ibatis.ognl.SimpleNode.getValue(SimpleNode.java:)
at org.apache.ibatis.ognl.Ognl.getValue(Ognl.java:)
at org.apache.ibatis.ognl.Ognl.getValue(Ognl.java:)
at org.apache.ibatis.ognl.Ognl.getValue(Ognl.java:)
at org.apache.ibatis.builder.xml.dynamic.OgnlCache.getValue(OgnlCache.java:)
at org.apache.ibatis.builder.xml.dynamic.ExpressionEvaluator.evaluateBoolean(ExpressionEvaluator.java:)
at org.apache.ibatis.builder.xml.dynamic.IfSqlNode.apply(IfSqlNode.java:)
at org.apache.ibatis.builder.xml.dynamic.MixedSqlNode.apply(MixedSqlNode.java:)
at org.apache.ibatis.builder.xml.dynamic.TrimSqlNode.apply(TrimSqlNode.java:)
at org.apache.ibatis.builder.xml.dynamic.MixedSqlNode.apply(MixedSqlNode.java:)
at org.apache.ibatis.builder.xml.dynamic.TrimSqlNode.apply(TrimSqlNode.java:)
at org.apache.ibatis.builder.xml.dynamic.MixedSqlNode.apply(MixedSqlNode.java:)
at org.apache.ibatis.builder.xml.dynamic.MixedSqlNode.apply(MixedSqlNode.java:)
at org.apache.ibatis.builder.xml.dynamic.DynamicSqlSource.getBoundSql(DynamicSqlSource.java:)
at org.apache.ibatis.mapping.MappedStatement.getBoundSql(MappedStatement.java:)
at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:)
at sun.reflect.GeneratedMethodAccessor143.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:)
at java.lang.reflect.Method.invoke(Method.java:)
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:)
... more
sql:
<![CDATA[
SELECT inn.inner_org_id, inn.org_code FROM inner_org inn, org_relation rel WHERE inn.inner_org_id=rel.relation_id and rel.parent_id = #{parentId}
]]>
解决方法1:
将参数名(上面的例子为’parentId’)替换为”_parameter”
解决方法2:
Dao层接口方法的参数声明加上@Param("parentId")
如:List<Inner> findInnerByPid(@Param("parentId") String parentId);
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 'zoneId' in 'class java.lang.String'
本文为博主原创,未经允许不得而转载: 异常展示: dao层定义的接口为: public int getClientTotal(); 在mybatis中的sql为: <select id=&quo ...
- 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笔记四: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 ...
- 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 ' ...
- 【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 ...
- nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'enterpriseId' in 'class java.lang.String'
错误信息: nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for p ...
- 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映射,抛出Cause: org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'oid' in 'class java.lang.String'
原因在于: 在MyBatis中使用动态语句的判断时,传入的参数(parameterType)为Java基本数据类型,获取的结果(resultType)为JavaBean对象,此时就会抛出该异常,此时可 ...
随机推荐
- MVC的JavaScriptResult使用
JavaScriptResult的使用有两个必要的前提: 1.Ajax 2.jquery.unobtrusive-ajax.js 使用代码示例 controller public ActionResu ...
- c# 文字首字母
public string GetFirstLetter(string hz) { string ls_second_eng = "CJWGNSPGCGNESYPBTYYZDXYKYGTDJ ...
- es 剩余磁盘空间达到es最小值,添加数据被block
剩余磁盘空间达到es最小值,添加数据被block PUT _all/_settings {"index.blocks.read_only_allow_delete": null} ...
- java 缩放算法 双线性插值,双三次插值
双线性插值的效果对于放大的图像而言较领域插值来得平滑,但是却使得图像变得模糊而且仍然会有一部分锯齿现象. 双三次插值更好比双线性插值更好. 图像缩放之双三次插值法 数字图像处理之双线性插值
- 在windows下实时监控、接受文件变化小工具
在windows下实时监控文件变化小工具 在测试的时候,我们可能想实时监控系统打出的log信息,在unix系统上我们可以用"tail -f"实现,在windows下一般就无法做 ...
- Paxos算法细节详解(一)
Paxos分析 最近研究paxos算法,看了许多相关的文章,概念还是很模糊,觉得还是没有掌握paxos算法的精髓,所以花了3天时间分析了libpaxos3的所有代码,此代码可以从https://bit ...
- Java设计模式(16)中介模式(Mediator模式)
Mediator定义:用一个中介对象来封装一系列关于对象交互行为. 为何使用Mediator模式/中介模式 各个对象之间的交互操作非常多,每个对象的行为操作都依赖彼此对方,修改一个对象的行为,同时会涉 ...
- Java设计模式(1)工厂模式(Factory模式)
工厂模式定义:提供创建对象的接口. 为何使用工厂模式 工厂模式是我们最常用的模式了,著名的Jive论坛,就大量使用了工厂模式,工厂模式在Java程序系统可以说是随处可见. 为什么工厂模式是如此常用?因 ...
- Redis 学习笔记1
配置文件: 根据配置文件打开服务器: redis-server redis.conf --port 6370 redis-cli -localhost -p 6370 动态设置/获取配置选项的值 CO ...
- HashMap的长度为什么要是2的n次方
HashMap为了存取高效,要尽量较少碰撞,就是要尽量把数据分配均匀,每个链表长度大致相同,这个实现就在把数据存到哪个链表中的算法: 这个算法实际就是取模,hash%length,计算机中直接求余效率 ...