lunatech-labs / lunatech-beginner-quarkus-course-v2

Quarkus course for beginners - updated to utilise Course Management Tools
2 stars 3 forks source link

Fix/hibernate entity sequence #13

Closed RasDeaks closed 11 months ago

RasDeaks commented 11 months ago

Due to hibernate 6 migration

"As of 6.0, Hibernate by default creates a sequence per entity hierarchy instead of a single sequence hibernate_sequence."

What has been done for quarkus 2 -> 3 migration :

-> PanacheEntity replaced by PanacheEntityBase with explcit ID anoted with @GeneratedValue

-> Sequence was removed

Problem :

-> POST without ID broken

-> update broken

Proposal to fix & simplify :

-> bring back sequence : use per entity sequence as required by hibernate 6 (e.g. Product_seq)

-> revert PanacheEntityBase, use PanacheEntity to simplify Entity