mybatis基于annotation的方式取得自增长ID值
程序员文章站
2022-06-07 14:59:12
...
参考:http://www.mybatis.org/core/java-api.html
This example shows using the @SelectKey annotation to retrieve an identity 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);