Merge branch 'RED-8248' into 'master'
RED-8248: Sent comments are not sorted by order of arrival Closes RED-8248 See merge request redactmanager/persistence-service!321
This commit is contained in:
commit
9329023ff6
@ -108,7 +108,7 @@ public class CommentService {
|
||||
|
||||
public List<Comment> getComments(String fileId, String annotationId) {
|
||||
|
||||
return toCommentList(commentPersistenceService.findCommentsByAnnotationId(fileId, annotationId, false));
|
||||
return toCommentList(commentPersistenceService.findCommentsByAnnotationIdSortByDate(fileId, annotationId, false));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -78,6 +78,12 @@ public class CommentPersistenceService {
|
||||
}
|
||||
|
||||
|
||||
public List<CommentEntity> findCommentsByAnnotationIdSortByDate(String fileId, String annotationId, boolean includeDeletions) {
|
||||
|
||||
return commentRepository.findByFileIdAndAnnotationIdOrderByDate(fileId, annotationId, includeDeletions);
|
||||
}
|
||||
|
||||
|
||||
@Transactional
|
||||
public void softDelete(long commentId, OffsetDateTime softDeletedTime) {
|
||||
|
||||
|
||||
@ -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