C/C++教程

mybatis查询参数报jdbcType属性为空

本文主要是介绍mybatis查询参数报jdbcType属性为空,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!

查询报异常:

nested exception is org.apache.ibatis.exceptions.PersistenceException: \n### Error querying database. Cause: java.lang.IllegalStateException: Type handler was null on parameter mapping for property 'unitFitmentList'. It was either not specified and/or could not be found for the javaType (java.util.List) : jdbcType (null) combination.\n### Cause: java.lang.IllegalStateException: Type handler was null on parameter mapping for property 'unitFitmentList'. It was either not specified and/or could not be found for the javaType (java.util.List) : jdbcType (null) combination.

解决:

在dao层给参数加上@Param,正常查询

 

原因:

具体原因不清楚,估计是未加@Param,会有参数类型丢失的风险

这篇关于mybatis查询参数报jdbcType属性为空的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!