Implemented feedback

This commit is contained in:
Raf Ponsaerts
2019-05-02 15:08:08 +02:00
parent 7dfd34036c
commit 6e21bcdad1
2 changed files with 3 additions and 7 deletions

View File

@@ -1500,17 +1500,16 @@ prevent the generation of resource policy entry values with null dspace_object a
} }
private String getEntityTypeStringFromMetadata(List<MetadataValue> list) { private String getEntityTypeStringFromMetadata(List<MetadataValue> list) {
String entityType = null;
for (MetadataValue mdv : list) { for (MetadataValue mdv : list) {
if (StringUtils.equals(mdv.getMetadataField().getMetadataSchema().getName(), if (StringUtils.equals(mdv.getMetadataField().getMetadataSchema().getName(),
"relationship") "relationship")
&& StringUtils.equals(mdv.getMetadataField().getElement(), && StringUtils.equals(mdv.getMetadataField().getElement(),
"type")) { "type")) {
entityType = mdv.getValue(); return mdv.getValue();
} }
} }
return entityType; return null;
} }
private RelationshipMetadataValue constructResultingMetadataValue(Item item, String value, private RelationshipMetadataValue constructResultingMetadataValue(Item item, String value,

View File

@@ -248,10 +248,7 @@ public class RelationshipServiceImpl implements RelationshipService {
return false; return false;
} }
String leftEntityType = list.get(0).getValue(); String leftEntityType = list.get(0).getValue();
if (!StringUtils.equals(leftEntityType, entityTypeToProcess.getLabel())) { return StringUtils.equals(leftEntityType, entityTypeToProcess.getLabel());
return false;
}
return true;
} }
public Relationship find(Context context, int id) throws SQLException { public Relationship find(Context context, int id) throws SQLException {