From ec724407d2ea345aff77e1de0bcc3968a99b8c16 Mon Sep 17 00:00:00 2001 From: dix Date: Fri, 27 Oct 2023 15:05:50 +0200 Subject: [PATCH] fix : hibernate entity sequence, forgotten entities in exercice 10 & 14 --- .../com/lunatech/training/quarkus/Product.java | 13 +++---------- .../com/lunatech/training/quarkus/Product.java | 15 ++++----------- 2 files changed, 7 insertions(+), 21 deletions(-) diff --git a/code/exercise_010_Validation_and_PUT/src/main/java/com/lunatech/training/quarkus/Product.java b/code/exercise_010_Validation_and_PUT/src/main/java/com/lunatech/training/quarkus/Product.java index f4ff16f..4d8b223 100644 --- a/code/exercise_010_Validation_and_PUT/src/main/java/com/lunatech/training/quarkus/Product.java +++ b/code/exercise_010_Validation_and_PUT/src/main/java/com/lunatech/training/quarkus/Product.java @@ -1,24 +1,17 @@ package com.lunatech.training.quarkus; import io.quarkus.hibernate.orm.panache.PanacheEntity; -import io.quarkus.hibernate.orm.panache.PanacheEntityBase; -import jakarta.persistence.GeneratedValue; -import jakarta.persistence.GenerationType; -import jakarta.persistence.Id; -import org.hibernate.validator.constraints.Length; import jakarta.persistence.Entity; import jakarta.validation.constraints.DecimalMin; import jakarta.validation.constraints.Digits; import jakarta.validation.constraints.NotNull; +import org.hibernate.validator.constraints.Length; + import java.math.BigDecimal; @Entity -public class Product extends PanacheEntityBase { - - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - public Long id; +public class Product extends PanacheEntity { @NotNull @Length(min = 3) diff --git a/code/exercise_015_Connecting_to_Kafka/src/main/java/com/lunatech/training/quarkus/Product.java b/code/exercise_015_Connecting_to_Kafka/src/main/java/com/lunatech/training/quarkus/Product.java index f46f133..14b2d87 100644 --- a/code/exercise_015_Connecting_to_Kafka/src/main/java/com/lunatech/training/quarkus/Product.java +++ b/code/exercise_015_Connecting_to_Kafka/src/main/java/com/lunatech/training/quarkus/Product.java @@ -1,24 +1,17 @@ package com.lunatech.training.quarkus; -import io.quarkus.hibernate.reactive.panache.PanacheEntityBase; +import io.quarkus.hibernate.reactive.panache.PanacheEntity; import io.vertx.mutiny.sqlclient.Row; +import org.hibernate.validator.constraints.Length; + import jakarta.persistence.Entity; -import jakarta.persistence.GeneratedValue; -import jakarta.persistence.GenerationType; -import jakarta.persistence.Id; import jakarta.validation.constraints.DecimalMin; import jakarta.validation.constraints.Digits; import jakarta.validation.constraints.NotNull; -import org.hibernate.validator.constraints.Length; - import java.math.BigDecimal; @Entity -public class Product extends PanacheEntityBase { - - @Id - @GeneratedValue(strategy = GenerationType.IDENTITY) - public Long id; +public class Product extends PanacheEntity { @NotNull @Length(min = 3)