Changeset 8f1b7e9 in Git for src/main/java/com/wediscussmovies/project/repository
- Timestamp:
- 02/10/22 13:28:00 (3 years ago)
- Branches:
- main
- Children:
- 980eeda
- Parents:
- 6f91f99
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/com/wediscussmovies/project/repository/DiscussionRepository.java
r6f91f99 r8f1b7e9 19 19 List<Discussion> findAllByPerson (Person person); 20 20 21 @Query(value = "select new com.wediscussmovies.project.querymodels.DiscussionLikesQM(d.discussionId, count (dl.id.userId)) from Discussion d" +21 @Query(value = "select new com.wediscussmovies.project.querymodels.DiscussionLikesQM(d.discussionId, count (dl.user) ) from Discussion d" + 22 22 " left join DiscussionLikes dl on dl.id.discussionId = d.discussionId" + 23 " where :discussionId = d.discussionId" + 24 " group by d.discussionId"+ 25 " order by count(dl.id.userId) desc") 23 " where :id = d.discussionId" + 24 " group by d.discussionId") 26 25 @Transactional 27 DiscussionLikesQM findDiscussionWithLikes(@Param(" discussionId") Integer discussionId);26 DiscussionLikesQM findDiscussionWithLikes(@Param("id") Integer discussionId); 28 27 29 @Query(value = "select new com.wediscussmovies.project.querymodels.DiscussionLikesQM (d.discussionId, count(dl.id.userId))from Discussion d" +28 @Query(value = "select new com.wediscussmovies.project.querymodels.DiscussionLikesQM (d.discussionId, count(dl.user)) from Discussion d" + 30 29 " left join DiscussionLikes dl on dl.id.discussionId = d.discussionId" + 31 30 " group by d.discussionId"+ 32 " order by count(dl.id.userId) desc")31 " order by d.discussionId asc") 33 32 @Transactional 34 List<DiscussionLikesQM> findAllDiscussionsWithLikes(); 33 List<DiscussionLikesQM 34 > findAllDiscussionsWithLikes(); 35 35 }
Note:
See TracChangeset
for help on using the changeset viewer.