How to insert new items with Hibernate?

Got this to work with the help of this link: http://www.coderanch.com/t/487173/ORM/databases/hibernate-sequence-exist

Apparently hibernate looks for sequence tables for generating the id. Setting the following:

@GeneratedValue(strategy = GenerationType.IDENTITY)

on the id, causes it to use the underlying db's auto increment and not try to generate the id itself, and now it works.


I accidentally removed hibernate_sequence table in my db. Change:

spring.jpa.hibernate.ddl-auto=none

to

spring.jpa.hibernate.ddl-auto=create

In your application.properties file so Hibernate could recreate this table by himself