there is no readable property named的原因

这个问题是由于ibatis读取parameterClass 的属性时,即##中的名称时,没有找到当前的属性,所以他认为这个属性是no readable 的。所以只要找到ibatis能找到这个属性就可以了。


 例如:parameterClass 为Student这个对象,在ibatis中引用型对象的属性值必须使用该属性的名称,就像向下面的#name#不能使用其他代替一样,因为ibtis是通过getset方法找到这个属性名的。当他找不到时就会报no readable这个错了。所以只要##中的名称是Student的属性名。

	<update id="updateStudent" parameterClass="Student">
	   update tbl_student set
	   name=#name#,birth=#birth#,score=#score# where id=#id#
	</update>

一般parameterClass 是引用型对象,可能是修改类后没有编译

如果是基本数据类型,则改为#value#,就可以了

猜你喜欢

转载自237312569.iteye.com/blog/2293110