small fix
This commit is contained in:
parent
de40adea46
commit
6bb095a62d
|
@ -157,8 +157,29 @@ public class DescriptionCommonModelBuilder extends BaseCommonModelBuilder<Descri
|
|||
this.logger.debug("checking related - {}", DefinitionEntity.class.getSimpleName());
|
||||
|
||||
Map<UUID, UUID> itemMap = new HashMap<>();
|
||||
PlanDescriptionTemplateQuery q = this.queryFactory.query(PlanDescriptionTemplateQuery.class).disableTracking().authorize(this.authorize).ids(data.stream().map(DescriptionEntity::getPlanDescriptionTemplateId).distinct().collect(Collectors.toList()));
|
||||
List<PlanDescriptionTemplateEntity> items = q.collectAs(new BaseFieldSet().ensure(PlanDescriptionTemplate._id).ensure(PlanDescriptionTemplate._sectionId));
|
||||
PlanDescriptionTemplateQuery q = null;
|
||||
List<PlanDescriptionTemplateEntity> items;
|
||||
if (this.isPublic) {
|
||||
try {
|
||||
this.entityManager.disableTenantFilters();
|
||||
q =this.queryFactory.query(PlanDescriptionTemplateQuery.class).disableTracking().authorize(this.authorize).ids(data.stream().map(DescriptionEntity::getPlanDescriptionTemplateId).distinct().collect(Collectors.toList()));
|
||||
items = q.collectAs(new BaseFieldSet().ensure(PlanDescriptionTemplate._id).ensure(PlanDescriptionTemplate._sectionId));
|
||||
try {
|
||||
this.entityManager.reloadTenantFilters();
|
||||
} catch (InvalidApplicationException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
} finally {
|
||||
try {
|
||||
this.entityManager.reloadTenantFilters();
|
||||
} catch (InvalidApplicationException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
q =this.queryFactory.query(PlanDescriptionTemplateQuery.class).disableTracking().authorize(this.authorize).ids(data.stream().map(DescriptionEntity::getPlanDescriptionTemplateId).distinct().collect(Collectors.toList()));
|
||||
items = q.collectAs(new BaseFieldSet().ensure(PlanDescriptionTemplate._id).ensure(PlanDescriptionTemplate._sectionId));
|
||||
}
|
||||
for (PlanDescriptionTemplateEntity item : items){
|
||||
itemMap.put(item.getId(), item.getSectionId());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue