Skip to content

Commit

Permalink
add warning about dto and non-dto relationships (#25963)
Browse files Browse the repository at this point in the history
* add warning about dto and non-dto relationships

* Update generators/spring-boot/generator.ts

Co-authored-by: Matt Raible <[email protected]>

---------

Co-authored-by: Matt Raible <[email protected]>
  • Loading branch information
mshima and mraible authored Apr 25, 2024
1 parent c8e7b71 commit 44fb5e4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions generators/spring-boot/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -378,6 +378,13 @@ public void set${javaBeanCase(propertyName)}(${propertyType} ${propertyName}) {
);
}
},
checkDtoRelationships({ entity, entityName, relationship }) {
if (entity.dto !== relationship.otherEntity.dto) {
this.log.warn(
`Relationship between entities with different DTO configurations can cause unexpected results. Check ${relationship.relationshipName} in the ${entityName} entity.`,
);
}
},
prepareEntity({ relationship }) {
if (relationship.otherEntity.embedded) return;

Expand Down

0 comments on commit 44fb5e4

Please sign in to comment.