I have legacy Oracle db with a sequence named PRODUCT_ID_SEQ.
PRODUCT_ID_SEQ
Here is the mapping of Product class for which I need generate correct ids:<
Product
I use following on PostgreSQL and works just fine.
@Id @GeneratedValue(generator = "my_gen") @SequenceGenerator(name = "my_gen", sequenceName = "my_seq_in_db") private int userId;