Skip to content

Commit

Permalink
Added comments
Browse files Browse the repository at this point in the history
  • Loading branch information
NavidMitchell committed Jan 7, 2025
1 parent 24fd35b commit aeff69f
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,7 @@ private CompletableFuture<List<EntityHolder>> doProcess(RawJson json, EntityCont
jsonGenerator.writeNullField(fieldName);
}

// The id value comes from a top level object that is annotated wih @Id oor @AutoGeneratedId
// Any id fields in nested object are used for associations. Currently, associations are only used for GQL federated objects.
// The id value comes from a top level object that is annotated wih @Id or @AutoGeneratedId
if((decorator instanceof IdDecorator
|| decorator instanceof AutoGeneratedIdDecorator)
&& objectDepth == 1){
Expand All @@ -116,7 +115,7 @@ private CompletableFuture<List<EntityHolder>> doProcess(RawJson json, EntityCont
throw new IllegalArgumentException("Id field cannot be null or blank");
}

if(currentId != null){
if(currentId != null){ // should never happen, because the structure is validated when published
throw new IllegalArgumentException("Found multiple id fields in entity");
}

Expand Down

0 comments on commit aeff69f

Please sign in to comment.