Entity duplication occurs when tables are joined and multiple rows are matched. There are several methods to address this issue and they all use a Set to deduplicate entities.
However, it may not work in certain scenarios due to the fact that, depending on your SELECT clause, it could return newly instantiated arrays of your selected entities for each row.
People Mentioned
Ling-Chun SO
@shaolans
Software engineer specialized in Java/Spring Boot, I contributed to Open source projects like JHipster or Prettier-Java.
STORY’S CREDIBILITY
Original Reporting
This story contains new, firsthand information uncovered by the writer.