From 3c330e9800f12d0fc4072e4d700f839d8914923c Mon Sep 17 00:00:00 2001 From: Vincent Guillet Date: Tue, 20 May 2025 13:44:51 +0200 Subject: [PATCH] Refactor Publication class to use JOINED inheritance strategy and IDENTITY generation type --- .../src/main/java/com/humanbooster/model/Publication.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hibernate-project/src/main/java/com/humanbooster/model/Publication.java b/hibernate-project/src/main/java/com/humanbooster/model/Publication.java index 30c64d0..acae797 100644 --- a/hibernate-project/src/main/java/com/humanbooster/model/Publication.java +++ b/hibernate-project/src/main/java/com/humanbooster/model/Publication.java @@ -5,12 +5,12 @@ import jakarta.persistence.*; import java.time.LocalDate; @Entity -@Inheritance(strategy = InheritanceType.TABLE_PER_CLASS) +@Inheritance(strategy = InheritanceType.JOINED) @DiscriminatorColumn public abstract class Publication { @Id - @GeneratedValue(strategy = GenerationType.AUTO) + @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; @Column(nullable = false, length = 200)