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);
}
@Rest