Added facet creation even with a provided header

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/information-system/resource-registry@135182 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Luca Frosini 2016-12-01 17:14:14 +00:00
parent 6d0d99f0a8
commit d8943fa68e
1 changed files with 11 additions and 1 deletions

View File

@ -516,8 +516,18 @@ public class EntityManagementImpl implements EntityManagement {
UUID targetUUID = targetHeader.getUUID();
String entityType = getClassProperty(target);
try {
targetVertex = getEntity(orientGraph, targetUUID, entityType,
targetClass);
}catch(FacetNotFoundException e){
/* Facet does not exist. Going to create it */
targetVertex = createVertexEntity(orientGraph,
getClassProperty(target), Facet.class,
target.toString());
} catch (ResourceRegistryException e) {
throw e;
}
}
return targetVertex;