Skip to content

Commit

Permalink
LAZY, updated TaskRepository.java
Browse files Browse the repository at this point in the history
  • Loading branch information
Alina Tarasova committed Jul 30, 2024
1 parent 334d13a commit 3e2feea
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/java/hexlet/code/repository/TaskRepository.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ public interface TaskRepository extends JpaRepository<Task, Long>, JpaSpecificat
@Query("SELECT t FROM Task t WHERE t.id IN :taskIds")
Set<Task> findByIdIn(@Param("taskIds") Set<Long> taskIds);

@Query("SELECT t FROM Task t LEFT JOIN FETCH t.labels LEFT JOIN FETCH " +
"t.assignee LEFT JOIN FETCH t.taskStatus WHERE t.name = :name")
@Query("SELECT t FROM Task t LEFT JOIN FETCH t.labels LEFT JOIN FETCH "
+ "t.assignee LEFT JOIN FETCH t.taskStatus WHERE t.name = :name")
Optional<Task> findByNameWithEagerUpload(@Param("name") String name);

@Query("SELECT t FROM Task t LEFT JOIN FETCH t.labels LEFT JOIN FETCH " +
"t.assignee LEFT JOIN FETCH t.taskStatus WHERE t.id = :id")
@Query("SELECT t FROM Task t LEFT JOIN FETCH t.labels LEFT JOIN FETCH "
+ "t.assignee LEFT JOIN FETCH t.taskStatus WHERE t.id = :id")
Optional<Task> findByIdWithEagerUpload(@Param("id") Long id);


Expand Down

0 comments on commit 3e2feea

Please sign in to comment.