From 444d794d912ea00aa1680458ca7701dc1245f59c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Yoann=20Rodi=C3=A8re?= Date: Tue, 25 Jun 2024 10:24:22 +0200 Subject: [PATCH] Work around HHH-18285 in tests See https://hibernate.atlassian.net/browse/HHH-18285 --- ...teEntityEnhancerPresentEmbeddableTest.java | 24 +++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/extensions/hibernate-orm/deployment/src/test/java/io/quarkus/hibernate/orm/enhancer/HibernateEntityEnhancerPresentEmbeddableTest.java b/extensions/hibernate-orm/deployment/src/test/java/io/quarkus/hibernate/orm/enhancer/HibernateEntityEnhancerPresentEmbeddableTest.java index 789b88ff5fb32d..4f9fd280eb32d3 100644 --- a/extensions/hibernate-orm/deployment/src/test/java/io/quarkus/hibernate/orm/enhancer/HibernateEntityEnhancerPresentEmbeddableTest.java +++ b/extensions/hibernate-orm/deployment/src/test/java/io/quarkus/hibernate/orm/enhancer/HibernateEntityEnhancerPresentEmbeddableTest.java @@ -229,7 +229,6 @@ public void setEmbeddableMapValueWithAnnotation( } @Embeddable - @MappedSuperclass public static class EmbeddableWithAnnotation { private String text; @@ -283,8 +282,29 @@ public void setEmbedded(EmbeddableWithAnnotation embedded) { } } + @MappedSuperclass + public static abstract class MappedSuperclassForEmbeddable { + private String text; + + protected MappedSuperclassForEmbeddable() { + // For Hibernate ORM only - it will change the property value through reflection + } + + public MappedSuperclassForEmbeddable(String text) { + this.text = text; + } + + public String getText() { + return text; + } + + public void setText(String text) { + this.text = text; + } + } + @Embeddable - public static class ExtendedEmbeddableWithAnnotation extends EmbeddableWithAnnotation { + public static class ExtendedEmbeddableWithAnnotation extends MappedSuperclassForEmbeddable { private Integer integer; protected ExtendedEmbeddableWithAnnotation() {