spring-data-jpa 报错:Parameter value element [null] did not match expected type [java.lang.String (n/a
2018-11-30 22:36
1246 查看
(spring-data-jpa 报错:Parameter value element [null] did not match expected type [java.lang.String (n/a)])
报错如下:
代码中使用了 in 查询:
List<OrderMasterExpense> findByBuyerOpenidInAndTypeAndUpdateTimeBetween(List<String> buyerOpenidList, Integer type, Date beginDate, Date endDate);
注意:上面方法第一个参数的类型为
List<String>
造成报错的根本原因在于:调用该方法时传入的第一个参数 buyerOpenidList 中含有 null 值, 过滤掉 null 值后再次测试,未出现问题。
相关文章推荐
- org.springframework.dao.InvalidDataAccessApiUsageException: Parameter value [41] did not match expected type [java.lang.Integer (n/a)];
- Parameter value [Fri Nov 11 00:00:00 CST 2016] did not match expected type [java.util.Date (未解决 求评论
- jpa语句报 org.springframework.dao.InvalidDataAccessApiUsageException: Parameter with that position [2] did not exist; nested exception is java.lang.IllegalArgumentException: Parameter with that position
- spring data jpa 错误 Not an managed type: class java.lang.Object
- spring Failed to convert property value of type 'java.lang.String' to required type 'int' for proper
- IllegalArgumentException occured : Parameter value [camera]was not matching type [java.lang.Double]
- 《Springboot极简教程》MappingMongoConverter:Failed to convert from type [java.lang.String] to type [long] for value 'null'; ne
- Name for argument type [java.lang.String] not available, and parameter name information not found in
- Spring 整合 Flex (BlazeDS)无法从as对象 到 Java对象转换的异常:org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type 'java.util.Date' to required type 'java.sql.Timestamp' for property 'wfsj'; nested exception is java.lang.Ill
- 配置Spring Cannot convert value of type [java.lang.String] to required type [javax.sql.DataSource]
- Failed to convert value of type 'java.lang.String' to required type 'org.springframework.web.multipa
- spring data jpa boot thymeleaf hibernate manytoone 双向关联 java.lang.StackOverflowError: null
- Spring之AOP奇葩报错:Null return value from advice does not match primitive return type for
- @RequestParam注解使用:Name for argument type [java.lang.String] not available, and parameter name information not found in class file either.
- spring-data-jpa双向表关联查询时引发异常:java.lang.StackOverflowError: null
- SpringMVC Failed to convert from type java.lang.String to type java.util.Date for value '2014-12-02'
- spring data jpa 报错 java.lang.NullPointerException
- Name for argument type [java.lang.String] not available, and parameter name information not found in
- Property 'value' not found on type java.lang.String的错误原因
- spring Failed to convert property value of type 'java.lang.String' to required type 'int' for proper