报错
There is no getter for property named ‘productId’ in ‘class java.lang.String’] with root cause
意思是String类没有productId属性的getter方法,他确实是没有,因为他本来就没有personName属性的getter方法。
原因
参与动态sql时,mybatis会以OGNL对象树的形式即String.personName取值,导致异常抛出。
解决
@Param注解指定key,然后使用该key。
即dao层这样:
List<ProductAll> getProductAll(@Param("productId") String productId);