RED-8702: Explore document databases to store entityLog #415

Closed
maverick.studer wants to merge 88 commits from RED-8702-backup into master
2 changed files with 2 additions and 2 deletions
Showing only changes of commit 1806e37d93 - Show all commits

View File

@ -21,7 +21,7 @@ public interface EntityLogEntryDocumentRepository extends MongoRepository<Entity
@Query("{ 'entityLogId' : ?0, 'changes.analysisNumber' : ?1 }")
List<EntityLogEntryDocument> findByEntityLogIdAndChangesAnalysisNumberGreaterEquals(String entityLogId, Integer analysisNumber);
List<EntityLogEntryDocument> findByEntityLogIdAndChangesAnalysisNumberEquals(String entityLogId, Integer analysisNumber);
@Query("{ 'entityLogId' : ?0}")

View File

@ -274,7 +274,7 @@ public class EntityLogMongoService {
Optional<EntityLog> optionalEntityLog = entityLogDocumentRepository.findEntityLogDocumentWithoutEntriesById(entityLogId)
.map(mapper::fromLogDocument);
optionalEntityLog.ifPresent(entityLog -> entityLog.getEntityLogEntry()
.addAll(entityLogEntryDocumentRepository.findByEntityLogIdAndChangesAnalysisNumberGreaterEquals(entityLogId, analysisNumber)
.addAll(entityLogEntryDocumentRepository.findByEntityLogIdAndChangesAnalysisNumberEquals(entityLogId, analysisNumber)
.stream()
.map(mapper::fromLogEntryDocument)
.toList()));