ibatis insert 后返回主键

  <insert id="insertAccount" parameterClass="Account"> 
    insert into ACCOUNT (
      ACC_ID,
      ACC_FIRST_NAME,
      ACC_LAST_NAME,
      ACC_EMAIL)
    values (
      seq_account.nextval, #firstName#, #lastName#, #emailAddress#
    )   
    <selectKey resultClass="int" keyProperty="id" >
      SELECT seq_account.currval AS ID from dual
  </selectKey>
  </insert>

你可能感兴趣的:(ibatis)