赞
踩
https://gitee.com/DanShenGuiZu/learnDemo/tree/mysql_mybaties_DB/mybatis-learn-master
<-------------insert---------> <insert id="insertAuthor" parameterType="domain.blog.Author" flushCache="true" statementType="PREPARED" keyProperty="" keyColumn="" useGeneratedKeys="" timeout="20"> <-------------update---------> <update id="updateAuthor" parameterType="domain.blog.Author" flushCache="true" statementType="PREPARED" timeout="20"> <-------------delete---------> <delete id="deleteAuthor" parameterType="domain.blog.Author" flushCache="true" statementType="PREPARED" timeout="20">
<insert id="insert" useGeneratedKeys="true"
keyProperty="id">
insert into user (user_name,password)
values (#{userName},#{password})
</insert>
<insert id="insert2">
insert into user (user_name,password)
values (#{userName},#{password})
<selectKey resultType="java.lang.Long" keyProperty="id" order="AFTER">
SELECT LAST_INSERT_ID()
</selectKey>
</insert>
<selectKey
keyProperty="id"
resultType="int"
order="BEFORE"
statementType="PREPARED">
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。