您的位置:首页 > 编程语言 > Java开发

ProbeException解决办法:There is no WRITEABLE property named 'id' in class 'java.lang.String'

2012-07-18 17:30 585 查看
<!-- 按天统计 -->
<insert id="insertVisitStatisticInfoDay" parameterClass="string">
<![CDATA[
insert into visit_statistic_day (app_id,user_num,pv,uv,visit_date)
select type_id as app_id ,count(distinct username) as user_num,count(id) as pv,
count(distinct ip) as uv, date_format(now_time,'%Y-%m-%d')  as visit_date
from superbosstongji.pv_$tbNo$ group by type_id
]]>
<!--<selectKey resultClass="int" keyProperty="id">
<![CDATA[SELECT LAST_INSERT_ID() AS ID ]]>
</selectKey>-->
</insert>

报这种异常主要是因为你设置对象keyProperty='id' 在类型为int类型,而你传进来的是string类型

<!--<selectKey resultClass="int" keyProperty="id">
<![CDATA[SELECT LAST_INSERT_ID() AS ID ]]>
</selectKey>-->
这行代码主要作用时当插入成功后,返回表的索引值,访异常解决的办法是注释这行几行代码,

或者在传进来的参数值里包含keyProperty=‘id'
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐