Merge branch 'dmp-refactoring' of https://code-repo.d4science.org/MaDgiK-CITE/argos into dmp-refactoring
This commit is contained in:
commit
f4cbc3742c
|
@ -101,10 +101,19 @@ public class FieldBuilder extends BaseBuilder<Field, FieldEntity> {
|
|||
},
|
||||
Reference::getId);
|
||||
} else {
|
||||
FieldSet clone = new BaseFieldSet(fields.getFields()).ensure(Reference._id);
|
||||
ReferenceQuery q = this.queryFactory.query(ReferenceQuery.class).authorize(this.authorize).ids(data.stream().map(FieldEntity::getTextListValue).flatMap(List::stream).map(UUID::fromString).distinct().collect(Collectors.toList()));
|
||||
itemMap = this.builderFactory.builder(ReferenceBuilder.class).authorize(this.authorize).asForeignKey(q, clone, Reference::getId);
|
||||
List<UUID> ids = new ArrayList<>();
|
||||
for (FieldEntity field: data) {
|
||||
if (field.getTextListValue() != null) {
|
||||
for (String value: field.getTextListValue()) {
|
||||
if (value != null && !ids.contains(value)) ids.add(UUID.fromString(value));
|
||||
}
|
||||
}
|
||||
}
|
||||
FieldSet clone = new BaseFieldSet(fields.getFields()).ensure(Reference._id);
|
||||
ReferenceQuery q = this.queryFactory.query(ReferenceQuery.class).authorize(this.authorize).ids(ids);
|
||||
itemMap = this.builderFactory.builder(ReferenceBuilder.class).authorize(this.authorize).asForeignKey(q, clone, Reference::getId);;
|
||||
}
|
||||
|
||||
if (!fields.hasField(Reference._id)) {
|
||||
itemMap.forEach((id, item) -> {
|
||||
if (item != null)
|
||||
|
|
Loading…
Reference in New Issue