Small fix
This commit is contained in:
parent
e698b198e7
commit
58d224b739
|
@ -107,7 +107,7 @@ public class DmpDatasetProfileMigrationService {
|
|||
|
||||
DmpDescriptionTemplateEntity data = new DmpDescriptionTemplateEntity();
|
||||
data.setId(UUID.randomUUID());
|
||||
data.setDescriptionTemplateId(item.getDatasetprofile().getId());
|
||||
data.setDescriptionTemplateGroupId(item.getDatasetprofile().getId());
|
||||
data.setDmpId(item.getDmp().getId());
|
||||
data.setCreatedAt(Instant.now());
|
||||
data.setUpdatedAt(Instant.now());
|
||||
|
@ -130,8 +130,10 @@ public class DmpDatasetProfileMigrationService {
|
|||
int page = 0;
|
||||
|
||||
DmpDescriptionTemplateQuery dmpDescriptionTemplateQuery = this.queryFactory.query(DmpDescriptionTemplateQuery.class);
|
||||
long total = dmpDescriptionTemplateQuery.count();
|
||||
List<DmpDescriptionTemplateEntity> dmpDescriptionTemplateEntities;
|
||||
do {
|
||||
logger.debug("Checking " + page * PageSize + " of " + total);
|
||||
dmpDescriptionTemplateQuery.setPage(new Paging(page * PageSize, PageSize));
|
||||
dmpDescriptionTemplateEntities = dmpDescriptionTemplateQuery.collect();
|
||||
|
||||
|
@ -142,7 +144,7 @@ public class DmpDatasetProfileMigrationService {
|
|||
continue;
|
||||
}
|
||||
if (currentEntity.getDmpId().equals(previousEntity.getDmpId())
|
||||
&& currentEntity.getDescriptionTemplateId().equals(previousEntity.getDescriptionTemplateId())
|
||||
&& currentEntity.getDescriptionTemplateGroupId().equals(previousEntity.getDescriptionTemplateGroupId())
|
||||
&& currentEntity.getSectionId().equals(previousEntity.getSectionId())
|
||||
) {
|
||||
logger.warn("Removing found duplicate DmpDescriptionTemplate entity ({}) after DmpDatasetProfiles migration", currentEntity.getId());
|
||||
|
|
Loading…
Reference in New Issue