0%

MYBAITS5–更新 删除

1
2
3
4
5
6
7
8
9
10
11
<update id=“updateAuthor”>
update Author set
username = #{username},
password = #{password},
email = #{email},
bio = #{bio}
where id = #{id}
</update>
<delete id=“deleteAuthor”>
delete from Author where id = #{id}
</delete>

说明:flushCache=”true”为更新二级缓存,timeout=“20”超时连接

1
2
3
4
5
6
7
8
9
10
11
12
13
<update
id=“updateAuthor”
parameterType=“domain.blog.Author”
flushCache=”true
statementType=“PREPARED”
timeout=“20”>

<delete
id=“deleteAuthor”
parameterType=“domain.blog.Author”
flushCache=”true
statementType=“PREPARED”
timeout=“20”>