日期:2014-05-16 浏览次数:20484 次
1.将数据库主键设置为自增 2. XML如下设置就OK,自增主键的部分设置为null view plaincopy to clipboardprint? <insert id="insertProduct-MYSQL" parameterClass="User"> insert into users values(null,#userName# ,#password#,#userType#); <selectKey resultClass="int" keyProperty="uid"> SELECT @@IDENTITY AS UID </selectKey> </insert>