There is no getter for property named 'account' in 'class java.lang.String'

来源:互联网 发布:济南新风向网络 编辑:程序博客网 时间:2024/06/08 10:02
org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'account' in 'class java.lang.String'
at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:79)
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:447)
at com.sun.proxy.$Proxy15.selectList(Unknown Source)
at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:231)
at org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:128)
at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:68)
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:53)
at com.sun.proxy.$Proxy19.findAllAgentDeal(Unknown Source)
at com.game.business.service.AgentDealServiceImpl.findAllAgentDealMessage(AgentDealServiceImpl.java:76)
at com.game.business.controller.AgentDealController.findAllAgentDealMessage(AgentDealController.java:28)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)

at java.lang.reflect.Method.invoke(Unknown Source)

持久层

public interface AgentDealMapper {


List<AgentDeal> findAllAgentDeal(String account);

错误原因:

Mybatis默认采用ONGL解析参数,所以会自动采用对象树的形式取string.account值,引起报错。

修改方法:

List<AgentDeal> findAllAgentDeal(@Param(value="account")String account);的方法说明参数值

0 0