Getting next value from sequence with jpa repository in postgreSQL Getting next value from sequence with jpa repository in postgreSQL postgresql postgresql

Getting next value from sequence with jpa repository in postgreSQL


I've found solution:

@Query(value = "SELECT nextval('item_id_seq')", nativeQuery =            true)    Long getNextSeriesId();

My mistake was that I used oracle syntax instead of postgreSQL, which I am using.