RED-8248: Sent comments are not sorted by order of arrival
This commit is contained in:
parent
42b410f6f7
commit
6321295d02
@ -80,10 +80,7 @@ public class CommentPersistenceService {
|
||||
|
||||
public List<CommentEntity> findCommentsByAnnotationIdSortByDate(String fileId, String annotationId, boolean includeDeletions) {
|
||||
|
||||
return commentRepository.findByFileIdAndAnnotationId(fileId, annotationId, includeDeletions)
|
||||
.stream()
|
||||
.sorted(Comparator.comparing(CommentEntity::getDate))
|
||||
.collect(Collectors.toList());
|
||||
return commentRepository.findByFileIdAndAnnotationIdOrderByDate(fileId, annotationId, includeDeletions);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -15,6 +15,9 @@ public interface CommentRepository extends JpaRepository<CommentEntity, Long> {
|
||||
@Query("select e from CommentEntity e where e.fileId = :fileId and e.annotationId = :annotationId and (:includeDeletions = true or e.softDeletedTime is null)")
|
||||
List<CommentEntity> findByFileIdAndAnnotationId(@Param("fileId") String fileId, @Param("annotationId") String annotationId, @Param("includeDeletions") boolean includeDeletions);
|
||||
|
||||
@Query("select e from CommentEntity e where e.fileId = :fileId and e.annotationId = :annotationId and (:includeDeletions = true or e.softDeletedTime is null) ORDER BY e.date")
|
||||
List<CommentEntity> findByFileIdAndAnnotationIdOrderByDate(@Param("fileId") String fileId, @Param("annotationId") String annotationId, @Param("includeDeletions") boolean includeDeletions);
|
||||
|
||||
|
||||
@Query("select e from CommentEntity e where e.fileId = :fileId and (:includeDeletions = true or e.softDeletedTime is null)")
|
||||
List<CommentEntity> findByFileId(@Param("fileId") String fileId, @Param("includeDeletions") boolean includeDeletions);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user