Skip to content

Commit

Permalink
[extract] replace entity graph with query
Browse files Browse the repository at this point in the history
  • Loading branch information
julian-christl committed Jan 26, 2024
1 parent 2da7576 commit 1c9329b
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,12 @@ default ProgrammingExercise findOneByProjectKeyOrThrow(String projectKey, boolea
""")
Optional<ProgrammingExercise> findWithEagerTemplateAndSolutionParticipationsById(@Param("exerciseId") Long exerciseId);

@EntityGraph(type = LOAD, attributePaths = "studentParticipations")
@Query("""
SELECT pe
FROM ProgrammingExercise pe
LEFT JOIN FETCH pe.studentParticipations
WHERE pe.id = :exerciseId
""")
Optional<ProgrammingExercise> findWithEagerStudentParticipationsById(Long exerciseId);

@Query("""
Expand Down

0 comments on commit 1c9329b

Please sign in to comment.