From 0bc198f26508daca913514186b0ec3ac5357e888 Mon Sep 17 00:00:00 2001 From: Gavin King Date: Fri, 23 Feb 2024 21:35:51 +0100 Subject: [PATCH] HHH-17772 handle missing static constant refs --- .../jpamodelgen/annotation/AnnotationMetaEntity.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/tooling/metamodel-generator/src/main/java/org/hibernate/jpamodelgen/annotation/AnnotationMetaEntity.java b/tooling/metamodel-generator/src/main/java/org/hibernate/jpamodelgen/annotation/AnnotationMetaEntity.java index 229d76a913..924699b539 100644 --- a/tooling/metamodel-generator/src/main/java/org/hibernate/jpamodelgen/annotation/AnnotationMetaEntity.java +++ b/tooling/metamodel-generator/src/main/java/org/hibernate/jpamodelgen/annotation/AnnotationMetaEntity.java @@ -1595,10 +1595,18 @@ public class AnnotationMetaEntity extends AnnotationMeta { final AnnotationMirror by = getAnnotationMirror( parameter, "jakarta.data.repository.By" ); final AnnotationMirror param = getAnnotationMirror( parameter, "jakarta.data.repository.Param" ); if ( by != null ) { - return (String) castNonNull( getAnnotationValue( by, "value" ) ); + final String name = (String) castNonNull(getAnnotationValue(by, "value")); + if ( name.contains("") ) { + throw new ProcessLaterException(); + } + return name; } else if ( param != null ) { - return (String) castNonNull( getAnnotationValue( param, "value" ) ); + final String name = (String) castNonNull(getAnnotationValue(param, "value")); + if ( name.contains("") ) { + throw new ProcessLaterException(); + } + return name; } else { return parameter.getSimpleName().toString();