Fixing code

This commit is contained in:
Luca Frosini 2023-05-17 14:03:59 +02:00
parent 76438c6a90
commit dab30f5670
2 changed files with 4 additions and 3 deletions

View File

@ -721,13 +721,14 @@ public abstract class ElementManagement<El extends OElement, T extends Type> {
oDatabaseDocument = getWorkingContext().getDatabaseDocument(PermissionMode.WRITER);
oDatabaseDocument.begin();
boolean update = false;
setAsEntryPoint();
try {
setAsEntryPoint();
getElement();
setOperation(Operation.UPDATE);
update = true;
internalUpdate();
} catch(NotFoundException e) {
setAsEntryPoint();
setOperation(Operation.CREATE);
String calledMethod = CalledMethodProvider.instance.get();
calledMethod = calledMethod.replace("update", "create");
CalledMethodProvider.instance.set(calledMethod);

View File

@ -187,7 +187,7 @@ public class FacetManagement extends EntityManagement<Facet, FacetType> {
}
public OVertex internalCreate() throws AlreadyPresentException, ResourceRegistryException {
if(entryPoint && operation == Operation.CREATE) {
if(entryPoint) {
throw new SchemaViolationException("You cannot create a stand alone Facet");
}
return super.internalCreate();