codecamp

MyBatis如何获取自动生成的主键id

MySQL:Mapper 文件 insert 语句设置    

useGeneratedKeys="true" keyProperty="id"

Oracle:Mapper 文件 insert 语句增加

<selectKey keyProperty="id" order="BEFORE" resultType="Integer">
 
    select xxx_SEQ.nextval from dual
 
</selectKey>


MyBatis是否可以映射到枚举类
MyBatis 传递多个参数
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定