JPA inheritance @EntityGraph include optional associations of subclasses
Given the following domain model, I want to load all Answer s including their Value s and their respective sub-children and put it in an AnswerDTO to then convert to JSON. I have a working solution but it suffers from the N+1 problem that I want to get rid of by using an ad-hoc @EntityGraph . All associations are configured LAZY . @Query("SELECT a FROM Answe