1.MySQL如何设置自动增长序列 SEQUENCE
请参照【链接】:https://blog.youkuaiyun.com/czbqoo01/article/details/70148516
2.在Navicat上编写函数



具体代码上述【链接】。
3.另外,与jpa的JpaRepository相结合。
public interface EmpsRepository extends JpaRepository<Emps, Long> {
@Query(value = "select nextval(?)", nativeQuery = true)
int selectEmpSeq(String str);
}
@RestController
@RequestMapping(path = "/mytest")

本文介绍了如何在MySQL中设置自动增长序列SEQUENCE,并在Navicat上编写相关函数,同时提及了与jpa的JpaRepository的结合使用。
最低0.47元/天 解锁文章
2702

被折叠的 条评论
为什么被折叠?



