天道酬勤,学无止境

mysql ibatis oracle

iBatis中的insert如何返回主键ID

iBatis中的insert如何返回主键ibatis insert返回Xml代码 <!-- Oracle SEQUENCE --> <insert id="insertProduct-ORACLE" parameterClass="com.domain.Product"> <selectKey resultClass="int" keyProperty="id" type="pre"> <![CDATA[SELECT STOCKIDSEQUENCE.NEXTVAL AS ID FROM DUAL]]> </selectKey> <![CDATA[insert into PRODUCT (PRD_ID,PRD_DESCRIPTION) values #id#,#description#)]]> </insert> <!-- Microsoft SQL Server IDENTITY Column --> <insert id="insertProduct-MS-SQL" parameterClass="com.domain.Product"> <![CDATA[insert into PRODUCT (PRD_DESCRIPTION) values (#description#) ]]> <selectKey resultClass="int" keyProperty="id"

2021-03-26 19:26:17    分类:博客    mysql ibatis oracle   数据库