Skip to content

Commit

Permalink
Fix lazy loading
Browse files Browse the repository at this point in the history
  • Loading branch information
kai-niemi committed Feb 13, 2024
1 parent 5476ee7 commit 0113e0f
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@

@Repository
public interface RaceRepository extends JpaRepository<Race, UUID> {
@Override
@Query(value = "select r from Race r "
+ "left join fetch r.bets b "
+ "where r.id=?1")
Optional<Race> findById(UUID id);

@Query(value = "select r.id from Race r "
+ "left join r.bets b "
+ "order by b.stake.amount desc, b.payout.amount desc")
Expand Down

0 comments on commit 0113e0f

Please sign in to comment.