From a12d589e775d0d235b8f8c5b800eb31d2918d8db Mon Sep 17 00:00:00 2001 From: Gavin King Date: Mon, 25 Mar 2024 12:42:50 +0100 Subject: [PATCH] use getAllMembers() when resolving Jakarta Data paths --- .../hibernate/processor/annotation/AnnotationMetaEntity.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java b/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java index d77e9223c1..30398f7581 100644 --- a/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java +++ b/tooling/metamodel-generator/src/main/java/org/hibernate/processor/annotation/AnnotationMetaEntity.java @@ -1916,14 +1916,13 @@ public class AnnotationMetaEntity extends AnnotationMeta { } private @Nullable Element memberMatchingPath(TypeElement entityType, String path) { - final StringTokenizer tokens = new StringTokenizer( path, "." ); - return memberMatchingPath( entityType, tokens ); + return memberMatchingPath( entityType, new StringTokenizer(path, ".") ); } private @Nullable Element memberMatchingPath(TypeElement entityType, StringTokenizer tokens) { final AccessType accessType = getAccessType(entityType); final String nextToken = tokens.nextToken(); - for ( Element member : entityType.getEnclosedElements() ) { + for ( Element member : context.getElementUtils().getAllMembers(entityType) ) { if ( "#id".equals(nextToken) && hasAnnotation( member, ID) ) { return member; }