use getAllMembers() when resolving Jakarta Data paths

This commit is contained in:
Gavin King 2024-03-25 12:42:50 +01:00 committed by Christian Beikov
parent 2c2413a773
commit a12d589e77
1 changed files with 2 additions and 3 deletions

View File

@ -1916,14 +1916,13 @@ public class AnnotationMetaEntity extends AnnotationMeta {
} }
private @Nullable Element memberMatchingPath(TypeElement entityType, String path) { private @Nullable Element memberMatchingPath(TypeElement entityType, String path) {
final StringTokenizer tokens = new StringTokenizer( path, "." ); return memberMatchingPath( entityType, new StringTokenizer(path, ".") );
return memberMatchingPath( entityType, tokens );
} }
private @Nullable Element memberMatchingPath(TypeElement entityType, StringTokenizer tokens) { private @Nullable Element memberMatchingPath(TypeElement entityType, StringTokenizer tokens) {
final AccessType accessType = getAccessType(entityType); final AccessType accessType = getAccessType(entityType);
final String nextToken = tokens.nextToken(); final String nextToken = tokens.nextToken();
for ( Element member : entityType.getEnclosedElements() ) { for ( Element member : context.getElementUtils().getAllMembers(entityType) ) {
if ( "#id".equals(nextToken) && hasAnnotation( member, ID) ) { if ( "#id".equals(nextToken) && hasAnnotation( member, ID) ) {
return member; return member;
} }