(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 值后再次测试,未出现问题。