@Insert(value = "INSERT INTO category (cat_name,cat_sort,is_enable) " +
"VALUES (#{catName},#{catSort},#{isEnable})")
//设置主键自增
@Options(useGeneratedKeys = true,keyProperty = "catId",keyColumn = "cat_id")
void insertCategory(Category category);
Mybatis注解设置自增主键
猜你喜欢
转载自blog.csdn.net/weixin_43596905/article/details/104868356
今日推荐
周排行