日期:2014-05-18 浏览次数:20808 次
<insert id="addPerson" parameterType="org.mybatis.dao.vo.Person">
<selectKey keyProperty="pid" resultType="int" order="BEFORE">
select person_seq.nextVal from dual
</selectKey>
insert into person(pid, pname, age, birthday )
values( #{pid}, #{pname}, #{age}, #{birthday} )
</insert>
// add
Person person = new Person();
//person.setPid(99);
person.setPname("周");
person.setAge(23);
person.setBirthday(Date.valueOf("2009-09-09"));
impl.addPerson(person);
<insert id="addPerson" parameterType="org.mybatis.dao.vo.Person">
<selectKey keyProperty="pid" resultType="int" order="BEFORE">
select person_seq.nextVal from dual
</selectKey>
insert into person(pid, pname, age, birthday )
values( #{pid,jdbcType=INTEGER}, #{pname,jdbcType=VARCHAR},
#{age,jdbcType=INTEGER}, #{birthday,jdbcType=DATE} )
</insert>