MyBatis+MySQL 返回插入的主鍵ID

需求:使用MyBatis往MySQL數據庫中插入一條記錄後,須要返回該條記錄的自增主鍵值。數據庫 方法:在mapper中指定keyProperty屬性,示例以下:mybatis <insert id="insertAndGetId" useGeneratedKeys="true" keyProperty="userId" parameterType="com.chenzhou.mybatis.Us
相關文章
相關標籤/搜索