Made elastic dmp mapping more safe

Remove_explore
George Kalampokis 3 years ago
parent 2ba3f11687
commit 91fc1bc5b1
  1. 4
      dmp-backend/elastic/src/main/java/eu/eudat/elastic/entities/Dmp.java

@ -242,7 +242,9 @@ public class Dmp implements ElasticEntity<Dmp> {
this.id = UUID.fromString((String) fields.get(MapKey.ID.getName()));
this.label = (String) fields.get(MapKey.LABEL.getName());
this.description = (String) fields.get(MapKey.DESCRIPTION.getName());
this.groupId = UUID.fromString((String) fields.get(MapKey.GROUPID.getName()));
if (fields.get(MapKey.GROUPID.getName()) != null) {
this.groupId = UUID.fromString((String) fields.get(MapKey.GROUPID.getName()));
}
this.status = Short.valueOf(fields.get(MapKey.STATUS.getName()).toString());
if (fields.get(MapKey.TEMPLATES.getName()) != null) {
this.templates = ((List<HashMap<String, Object>>) fields.get(MapKey.TEMPLATES.getName())).stream().map(hashMap -> new DatasetTempalate().fromElasticEntity(hashMap)).collect(Collectors.toList());

Loading…
Cancel
Save