在MyBatis的mapper中使用@Insert注解插入数据信息,但是并没有返回自增主键。
如果需要返回自增主键则需要在@Insert后加上@Option注解。
@Options(useGeneratedKeys=true,keyProperty="id")
在MyBatis的mapper中使用@Insert注解插入数据信息,但是并没有返回自增主键。
如果需要返回自增主键则需要在@Insert后加上@Option注解。
@Options(useGeneratedKeys=true,keyProperty="id")