MyBatis插入时返回主键

在insert标签里加入

useGeneratedKeys="true" keyProperty="id"

 如

<insert id="insert" useGeneratedKeys="true" keyProperty="id" parameterType="com.test.model.Booking">

posted on 2016-10-14 16:22  Yangguang.Liu  阅读(130)  评论(0编辑  收藏  举报