首页 新闻 会员 周边 捐助

动态SQL遇到了问题,请各位指点一下

0
悬赏园豆:20 [已解决问题] 解决于 2020-08-06 08:57





错误原因:
Exception in thread "main" org.apache.ibatis.exceptions.PersistenceException:

Error querying database. Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for com.wyy.mapperCustomerMapper.fincustomerbyname

Cause: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for com.wyy.mapperCustomerMapper.fincustomerbyname

at org.apache.ibatis.exceptions.ExceptionFactory.wrapException(ExceptionFactory.java:30)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:150)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:141)
at com.wyy.test.Testsql.main(Testsql.java:22)

Caused by: java.lang.IllegalArgumentException: Mapped Statements collection does not contain value for com.wyy.mapperCustomerMapper.fincustomerbyname
at org.apache.ibatis.session.Configuration$StrictMap.get(Configuration.java:875)
at org.apache.ibatis.session.Configuration.getMappedStatement(Configuration.java:708)
at org.apache.ibatis.session.Configuration.getMappedStatement(Configuration.java:701)
at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:147)
... 2 more

感觉是sql语句错了,但我看了好久感觉没问题呀

向死即生的主页 向死即生 | 初学一级 | 园豆:122
提问于:2020-08-05 10:47
< >
分享
最佳答案
1


一个明显的错误
com.wyy.mapperCustomerMapper.fincustomerbyname
少了一个标点
com.wyy.mapper.CustomerMapper.fincustomerbyname

收获园豆:20
8号位 | 小虾三级 |园豆:596 | 2020-08-05 11:25

谢谢,成功了

向死即生 | 园豆:122 (初学一级) | 2020-08-05 12:03
其他回答(1)
0

你可以试着把sql语句打印出来看下是不是错了

Mr·林 | 园豆:150 (初学一级) | 2020-08-05 11:05
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册