`
ssun125
  • 浏览: 41396 次
文章分类
社区版块
存档分类
最新评论

mybatis基于annotation的方式取得自增长ID值

 
阅读更多

参考: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);

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics