HHH-16938 Fix meta-annotations support for any discriminators

This commit is contained in:
Marco Belladelli 2023-08-07 14:30:47 +02:00
parent aa2cfe8a17
commit f69de54360
No known key found for this signature in database
GPG Key ID: D1D0C3030AE3AA35
1 changed files with 3 additions and 2 deletions

View File

@ -66,6 +66,7 @@ import jakarta.persistence.ManyToOne;
import jakarta.persistence.OneToOne; import jakarta.persistence.OneToOne;
import static org.hibernate.boot.model.internal.AnnotatedColumn.buildColumnOrFormulaFromAnnotation; 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.isEmpty;
import static org.hibernate.internal.util.StringHelper.isNotEmpty; import static org.hibernate.internal.util.StringHelper.isNotEmpty;
import static org.hibernate.internal.util.StringHelper.qualify; import static org.hibernate.internal.util.StringHelper.qualify;
@ -814,13 +815,13 @@ public class BinderHelper {
private static void processAnyDiscriminatorValues( private static void processAnyDiscriminatorValues(
XProperty property, XProperty property,
Consumer<AnyDiscriminatorValue> consumer) { Consumer<AnyDiscriminatorValue> consumer) {
final AnyDiscriminatorValue valueAnn = property.getAnnotation( AnyDiscriminatorValue.class ); final AnyDiscriminatorValue valueAnn = findAnnotation( property, AnyDiscriminatorValue.class );
if ( valueAnn != null ) { if ( valueAnn != null ) {
consumer.accept( valueAnn ); consumer.accept( valueAnn );
return; return;
} }
final AnyDiscriminatorValues valuesAnn = property.getAnnotation( AnyDiscriminatorValues.class ); final AnyDiscriminatorValues valuesAnn = findAnnotation( property, AnyDiscriminatorValues.class );
if ( valuesAnn != null ) { if ( valuesAnn != null ) {
for ( AnyDiscriminatorValue discriminatorValue : valuesAnn.value() ) { for ( AnyDiscriminatorValue discriminatorValue : valuesAnn.value() ) {
consumer.accept( discriminatorValue ); consumer.accept( discriminatorValue );