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.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);
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue