Pull request #296: Last atttribute change only for affected file

Merge in RED/persistence-service from lastattr-update-master to master

* commit '4b6e959ce3c617b56e60b297f0cc81d3cf0b71ec':
  Last atttribute change only for affected file
This commit is contained in:
Timo Bejan 2022-03-15 14:56:42 +01:00 committed by Dominique Eiflaender
commit 50f66f8286
2 changed files with 3 additions and 3 deletions

View File

@ -162,7 +162,7 @@ public class FileStatusPersistenceService {
var fileAttributeEntities = convertFileAttributes(dossierId, file, fileAttributes);
fileAttributesRepository.saveAllAndFlush(fileAttributeEntities);
fileRepository.updateLastAttributeChangeDate(OffsetDateTime.now().truncatedTo(ChronoUnit.MILLIS));
fileRepository.updateLastAttributeChangeDate(fileId, OffsetDateTime.now().truncatedTo(ChronoUnit.MILLIS));
}, () -> {
throw new NotFoundException("Unknown file=" + fileId);

View File

@ -145,8 +145,8 @@ public interface FileRepository extends JpaRepository<FileEntity, String> {
List<FileEntity> getAllRelevantStatusesForReanalysisScheduler();
@Modifying(clearAutomatically = true)
@Query("update FileEntity f set f.lastFileAttributeChange = :date, f.lastUpdated = :date")
void updateLastAttributeChangeDate(OffsetDateTime date);
@Query("update FileEntity f set f.lastFileAttributeChange = :date, f.lastUpdated = :date where f.id = :fileId")
void updateLastAttributeChangeDate(String fileId, OffsetDateTime date);
@Query("select f from FileEntity f where f.deleted is not null and f.hardDeletedTime is null and f.dossierId in :dossierIds")
List<FileEntity> getSoftDeletedFiles(List<String> dossierIds);