check if grant exists in dmp/dataset elastic entities
This commit is contained in:
parent
367861c050
commit
69548e5a8b
|
@ -231,7 +231,9 @@ public class Dataset implements ElasticEntity<Dataset> {
|
|||
if (this.group != null) {
|
||||
builder.field("group", this.group.toString());
|
||||
}
|
||||
builder.field("grant", this.grant.toString());
|
||||
if (this.grant != null) {
|
||||
builder.field("grant", this.grant.toString());
|
||||
}
|
||||
if (collaborators != null) {
|
||||
builder.startArray("collaborators");
|
||||
this.collaborators.forEach(x -> {
|
||||
|
@ -300,7 +302,9 @@ public class Dataset implements ElasticEntity<Dataset> {
|
|||
this.status = Short.valueOf((String) fields.get("status"));
|
||||
this.dmp = UUID.fromString((String) fields.get("dmp"));
|
||||
this.group = UUID.fromString((String) fields.get("group"));
|
||||
this.grant = UUID.fromString((String) fields.get("grant"));
|
||||
if (fields.get("grant") != null) {
|
||||
this.grant = UUID.fromString((String) fields.get("grant"));
|
||||
}
|
||||
if (fields.get("created") != null)
|
||||
this.created = Date.from(Instant.parse((String) fields.get("created")));
|
||||
if (fields.get("modified") != null)
|
||||
|
|
|
@ -323,7 +323,9 @@ public class Dmp implements ElasticEntity<Dmp> {
|
|||
if (fields.get(MapKey.DATASETS.getName()) != null) {
|
||||
this.datasets = ((List<HashMap<String, Object>>) fields.get(MapKey.DATASETS.getName())).stream().map(map -> new Dataset().fromElasticEntity(map)).collect(Collectors.toList());
|
||||
}
|
||||
this.grant = UUID.fromString((String) fields.get(MapKey.GRANT.getName()));
|
||||
if (fields.containsKey(MapKey.GRANT.getName()) && fields.get(MapKey.GRANT.getName()) != null) {
|
||||
this.grant = UUID.fromString((String) fields.get(MapKey.GRANT.getName()));
|
||||
}
|
||||
if (fields.get(MapKey.GRANTSTATUS.getName()) != null) {
|
||||
this.grantStatus = Short.valueOf(fields.get(MapKey.GRANTSTATUS.getName()).toString());
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue