67,512
社区成员
发帖
与我相关
我的任务
分享
<insert id="addGoodsAndReturnId" parameterType="com.project.entity.EmallGoodsWithBLOBs">
<!--
WARNING - @mbggenerated
This element is automatically generated by MyBatis Generator, do not modify.
-->
insert into EMALL_GOODS ( GOODSNAME, CLASSID,
)
values ( #{goodsname,jdbcType=VARCHAR})
SELECT @@IDENTITY AS GOODSID
</insert>
<insert id="myInsertStatement">
INSERT INTO TestTable (name, owner)
VALUES (#name#, #owner#)
<selectKey keyProperty="id" resultClass="int">
SELECT SCOPE_IDENTITY()
</selectKey>
</insert>
http://stackoverflow.com/questions/3455796/generating-dao-with-ibatis-problemuseGeneratedKeys="true" keyProperty="id">