mybatisはannotationに基づいて成長ID値を取得します。

2105 ワード

参考:http://www.mybatis.org/core/java-api.html
This example shows using the@SelectKey annotation to retrieve an dentity value after an insert:
@Insert("insert into table2 (name) values(#{name})")
@SelectKey(statement="call identity()", keyProperty="nameId", before=false, resultType=int.class)
int insertTable2(Name name);