ibatis插入获取自增id

<insert id="addadjunct" parameterClass="adjunct">
	insert into t_project_adjunct(fadjunct,ftype,fcreater,fcreatetime,fdeleted) 
	values(#name#,1,#creater#,sysdate(),0)
	<selectKey keyProperty="id" resultClass="int">
	  SELECT @@IDENTITY AS ID
   </selectKey>
</insert>
主要是
<selectKey keyProperty="id" resultClass="int">
	  SELECT @@IDENTITY AS ID
   </selectKey>
语句,不过要注意返回类型

你可能感兴趣的:(java,ibatis)