Skip to content

Commit bc9aa84

Browse files
committed
fix hibernate no session with left join fetch
1 parent 1c194a7 commit bc9aa84

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/main/java/de/tum/cit/aet/artemis/atlas/repository/CourseLearnerProfileRepository.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ public interface CourseLearnerProfileRepository extends ArtemisJpaRepository<Cou
4848
@Query("""
4949
SELECT clp
5050
FROM CourseLearnerProfile clp
51+
LEFT JOIN FETCH clp.course
5152
WHERE clp.learnerProfile.user.login = :login AND clp.course = :course
5253
""")
5354
Optional<CourseLearnerProfile> findByLoginAndCourse(@Param("login") String login, @Param("course") Course course);

0 commit comments

Comments
 (0)