Made elastic dmp mapping more safe

Remove_explore
George Kalampokis 4 years ago
parent 2ba3f11687
commit 91fc1bc5b1

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

Loading…
Cancel
Save