案例:

1. update

<?xml version="1.0" encoding="UTF-8" ?>  
<!DOCTYPE mapper  
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"  
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">  
<mapper namespace="com.accp.mybatis.model.Blog">  
    <update id="updateBlog" parameterType="Blog">    
       UPDATE Blog    
            SET title = #{title},     
                author_id = #{author.id},    
         WHERE id = #{id};  
    </update>    
</mapper>  

2. delete

<delete id="deleteBlog" parameterType="Blog">    
      DELETE FROM BLOG WHERE ID = #{id}    
</delete> 

update、delete语句属性配置细节:

5. Mybatis UPDATE更新,DELETE删除

 

相关文章:

  • 2022-12-23
  • 2021-11-29
  • 2021-05-16
  • 2021-05-15
  • 2021-08-15
  • 2021-11-13
  • 2022-12-23
  • 2021-12-27
猜你喜欢
  • 2022-12-23
  • 2021-04-26
  • 2022-12-23
  • 2021-09-13
  • 2021-12-03
  • 2022-12-23
相关资源
相似解决方案