Mybatis uses annotations to report reflection exceptions on the mapper interface

Annotation with Mybatis is to report reflection exception


Re-enter debugging, and then find that the two fields commentId and commentCount are not parsed and cannot be obtained from metaObject


Solution:

Add the param annotation to the parameters of the interface


If the interface is a parameter, it will not report an error. When there are multiple parameters, mybatis needs to specify the fill attribute corresponding to each parameter.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325973405&siteId=291194637