Fixing code
This commit is contained in:
parent
76438c6a90
commit
dab30f5670
|
@ -721,13 +721,14 @@ public abstract class ElementManagement<El extends OElement, T extends Type> {
|
||||||
oDatabaseDocument = getWorkingContext().getDatabaseDocument(PermissionMode.WRITER);
|
oDatabaseDocument = getWorkingContext().getDatabaseDocument(PermissionMode.WRITER);
|
||||||
oDatabaseDocument.begin();
|
oDatabaseDocument.begin();
|
||||||
boolean update = false;
|
boolean update = false;
|
||||||
|
setAsEntryPoint();
|
||||||
try {
|
try {
|
||||||
setAsEntryPoint();
|
|
||||||
getElement();
|
getElement();
|
||||||
|
setOperation(Operation.UPDATE);
|
||||||
update = true;
|
update = true;
|
||||||
internalUpdate();
|
internalUpdate();
|
||||||
} catch(NotFoundException e) {
|
} catch(NotFoundException e) {
|
||||||
setAsEntryPoint();
|
setOperation(Operation.CREATE);
|
||||||
String calledMethod = CalledMethodProvider.instance.get();
|
String calledMethod = CalledMethodProvider.instance.get();
|
||||||
calledMethod = calledMethod.replace("update", "create");
|
calledMethod = calledMethod.replace("update", "create");
|
||||||
CalledMethodProvider.instance.set(calledMethod);
|
CalledMethodProvider.instance.set(calledMethod);
|
||||||
|
|
|
@ -187,7 +187,7 @@ public class FacetManagement extends EntityManagement<Facet, FacetType> {
|
||||||
}
|
}
|
||||||
|
|
||||||
public OVertex internalCreate() throws AlreadyPresentException, ResourceRegistryException {
|
public OVertex internalCreate() throws AlreadyPresentException, ResourceRegistryException {
|
||||||
if(entryPoint && operation == Operation.CREATE) {
|
if(entryPoint) {
|
||||||
throw new SchemaViolationException("You cannot create a stand alone Facet");
|
throw new SchemaViolationException("You cannot create a stand alone Facet");
|
||||||
}
|
}
|
||||||
return super.internalCreate();
|
return super.internalCreate();
|
||||||
|
|
Loading…
Reference in New Issue