ITeye博客

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

cy913417 · 2012-09-12 15:07 · Mybatis · 数据库 · Markdown

mybatis查询 是传参 报

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

 这里是传入一个integer类型的参数,结果报上述异常

以下为sql写法:

	select  top ${contentSize} MAX(PrimaryKeyId) as id FROM  Content_TEMP  GROUP 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);

    结果正常。

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。