标签:tor map bat pre style type mybatis rom mapper
第一种:
<insert id="insertUser" parameterClass="ibatis.User"> <selectKey resultType="long" keyProperty="id"> select SEQ_TEST.NEXTVAL from dual </selectKey> insert into user (name,password) values (#name#,#password#) </insert>
第二种:
@Repository("empMapper") public interface EmpMapper { @Insert("insert into EMP(EMPNO,ENAME,HIREDATE,SAL) values (#{empno},#{ename},#{hiredate},#{sal})") @SelectKey(statement="select seq1.nextval from dual", keyProperty="empno",resultType=int.class,before=true) int add(Emp emp); }
标签:tor map bat pre style type mybatis rom mapper
原文地址:http://www.cnblogs.com/xiaoyunxia/p/6021476.html