From f69de54360ff7932ae98af57bbed1a2931b0b134 Mon Sep 17 00:00:00 2001 From: Marco Belladelli Date: Mon, 7 Aug 2023 14:30:47 +0200 Subject: [PATCH] HHH-16938 Fix meta-annotations support for any discriminators --- .../java/org/hibernate/boot/model/internal/BinderHelper.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/boot/model/internal/BinderHelper.java b/hibernate-core/src/main/java/org/hibernate/boot/model/internal/BinderHelper.java index 893cb493be..86bb87ab2a 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/model/internal/BinderHelper.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/model/internal/BinderHelper.java @@ -66,6 +66,7 @@ import jakarta.persistence.ManyToOne; import jakarta.persistence.OneToOne; import static org.hibernate.boot.model.internal.AnnotatedColumn.buildColumnOrFormulaFromAnnotation; +import static org.hibernate.boot.model.internal.HCANNHelper.findAnnotation; import static org.hibernate.internal.util.StringHelper.isEmpty; import static org.hibernate.internal.util.StringHelper.isNotEmpty; import static org.hibernate.internal.util.StringHelper.qualify; @@ -814,13 +815,13 @@ public class BinderHelper { private static void processAnyDiscriminatorValues( XProperty property, Consumer consumer) { - final AnyDiscriminatorValue valueAnn = property.getAnnotation( AnyDiscriminatorValue.class ); + final AnyDiscriminatorValue valueAnn = findAnnotation( property, AnyDiscriminatorValue.class ); if ( valueAnn != null ) { consumer.accept( valueAnn ); return; } - final AnyDiscriminatorValues valuesAnn = property.getAnnotation( AnyDiscriminatorValues.class ); + final AnyDiscriminatorValues valuesAnn = findAnnotation( property, AnyDiscriminatorValues.class ); if ( valuesAnn != null ) { for ( AnyDiscriminatorValue discriminatorValue : valuesAnn.value() ) { consumer.accept( discriminatorValue );