【问题标题】:mybatis update is not workingmybatis 更新不起作用
【发布时间】:2013-05-14 22:35:55
【问题描述】:

我正在使用 mybatis 进行更新,查询不更新表:谁能帮我解决问题

配置

    <update id="updateInfo" parameterType="int" timeout="20">
        UPDATE RULE_DETAILS
        SET state=0
        WHERE severity ='info'
        and cfg_id=#{cfg_id}   
    </update

打电话

session.selectList("updateInfo",  cfg_id);  

日志也显示

DEBUG java.sql.PreparedStatement - ==>  Executing: UPDATE RULE_DETAILS SET state=0 WHERE severity ='warning' and cfg_id=? 

DEBUG java.sql.PreparedStatement - ==> Parameters: 2572(Integer)

但数据库未使用此数据更新。谁能帮帮我..

【问题讨论】:

  • 确保您正在提交更新。您是否仅遇到此 SQL 的问题?你能做一个简单的选择或插入吗?

标签: ibatis mybatis


【解决方案1】:

使用 session.update() 但不使用 session.selectList()。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-10-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-01-19
    • 2010-10-03
    • 2016-08-04
    • 2015-08-24
    相关资源
    最近更新 更多