marty001 发表于 2016-11-28 08:17:10

mybatis There is no getter for property named 'xxxx' in 'class java.lang.Integer

  mybatis查询 是传参 报

There is no getter for property named 'xxxx' in 'class java.lang.Integer
  这里是传入一个integer类型的参数,结果报上述异常
  以下为sql写法:

selecttop ${contentSize} MAX(PrimaryKeyId) as id FROMContent_TEMPGROUP BY id

  此处报

There is no getter for property named 'contentSize' in 'class java.lang.Integer
  解决方法有二:
  1.将 参数名称 "contentSize" 替换为"_parameter" 
  结果正常。
  2. 在接口中定义方法时 增加“@Param("contentSize")” 标记
  即:

List<xxxx>selectContent(@Param("contentSize")int contentSize);
  结果正常。
页: [1]
查看完整版本: mybatis There is no getter for property named 'xxxx' in 'class java.lang.Integer