Skip to content

Commit

Permalink
Solved review comments
Browse files Browse the repository at this point in the history
bpasson committed Jan 22, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 3e83493 commit be75b5d
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -181,12 +181,12 @@ private FieldInfo resolveField(IndexView index, String parameterName, DotName cl
// N.B. as this module does not depend on any other module that could supply this @Id annotation
// (like Panache), we need this general lookup
// the order of preference for the annotations is @RestLinkId > @persistence.Id > id
FieldInfoSupplier byIdAnnotation = new FieldInfoSupplier(
FieldInfoSupplier byAnnotation = new FieldInfoSupplier(
c -> {
FieldInfo persistenceId = null;
for (FieldInfo field : c.fields()) {
// prefer RestLinId over Id
if (fieldAnnotatedWith(field, RestLinkId.class.getName())) {
if (field.hasAnnotation(RestLinkId.class)) {
return field;
}
// keep the first found @persistence.Id annotation in case not @RestLinkId is found
@@ -198,8 +198,9 @@ private FieldInfo resolveField(IndexView index, String parameterName, DotName cl
},
className,
index);
if (byIdAnnotation.get() != null) {
fieldInfo = byIdAnnotation.get();
FieldInfo annotatedField = byAnnotation.get();
if (annotatedField != null) {
fieldInfo = annotatedField;
}
}
return fieldInfo;

0 comments on commit be75b5d

Please sign in to comment.