diff --git a/src/main/java/org/gcube/informationsystem/resourceregistry/instances/model/entities/FacetManagement.java b/src/main/java/org/gcube/informationsystem/resourceregistry/instances/model/entities/FacetManagement.java index 99230fc..7b2667e 100644 --- a/src/main/java/org/gcube/informationsystem/resourceregistry/instances/model/entities/FacetManagement.java +++ b/src/main/java/org/gcube/informationsystem/resourceregistry/instances/model/entities/FacetManagement.java @@ -3,6 +3,7 @@ package org.gcube.informationsystem.resourceregistry.instances.model.entities; import org.gcube.com.fasterxml.jackson.databind.JsonNode; import org.gcube.informationsystem.base.reference.AccessType; import org.gcube.informationsystem.model.reference.entities.Facet; +import org.gcube.informationsystem.resourceregistry.api.exceptions.AlreadyPresentException; import org.gcube.informationsystem.resourceregistry.api.exceptions.NotFoundException; import org.gcube.informationsystem.resourceregistry.api.exceptions.ResourceRegistryException; import org.gcube.informationsystem.resourceregistry.api.exceptions.entity.facet.FacetAlreadyPresentException; @@ -122,4 +123,16 @@ public class FacetManagement extends EntityManagement { checkResource(); } + @Override + public String create() throws AlreadyPresentException, ResourceRegistryException { + throw new ResourceRegistryException("You cannot create an horphan Facet"); + } + + public OVertex internalCreate() throws AlreadyPresentException, ResourceRegistryException { + if(entryPoint && operation == Operation.CREATE) { + throw new ResourceRegistryException("You cannot create an horphan Facet"); + } + return super.internalCreate(); + } + }