public void afterUpdateOperations(final OIdentifiable id) { if (id instanceof ODocument) { ODocument doc = (ODocument) id; OImmutableClass clazz = ODocumentInternal.getImmutableSchemaClass(this, doc); if (clazz != null) { OClassIndexManager.checkIndexesAfterUpdate((ODocument) id, this); if (clazz.isFunction()) { this.getSharedContext().getFunctionLibrary().updatedFunction(doc); Orient.instance().getScriptManager().close(this.getName()); } if (clazz.isOuser() || clazz.isOrole()) { getMetadata().getSecurity().incrementVersion(); } if (clazz.isSequence()) { ((OSequenceLibraryProxy) getMetadata().getSequenceLibrary()).getDelegate().onSequenceUpdated(this, doc); } if (clazz.isTriggered()) { OClassTrigger.onRecordAfterUpdate(doc, this); } } OLiveQueryHook.addOp(doc, ORecordOperation.UPDATED, this); OLiveQueryHookV2.addOp(doc, ORecordOperation.UPDATED, this); } callbackHooks(ORecordHook.TYPE.AFTER_UPDATE, id); }
public void afterCreateOperations(final OIdentifiable id) { if (id instanceof ODocument) { ODocument doc = (ODocument) id; OImmutableClass clazz = ODocumentInternal.getImmutableSchemaClass(this, doc); if (clazz != null) { OClassIndexManager.checkIndexesAfterCreate(doc, this); if (clazz.isFunction()) { this.getSharedContext().getFunctionLibrary().createdFunction(doc); Orient.instance().getScriptManager().close(this.getName()); } if (clazz.isOuser() || clazz.isOrole()) { getMetadata().getSecurity().incrementVersion(); } if (clazz.isSequence()) { ((OSequenceLibraryProxy) getMetadata().getSequenceLibrary()).getDelegate().onSequenceCreated(this, doc); } if (clazz.isScheduler()) { getMetadata().getScheduler().scheduleEvent(new OScheduledEvent(doc)); } if (clazz.isTriggered()) { OClassTrigger.onRecordAfterCreate(doc, this); } } OLiveQueryHook.addOp(doc, ORecordOperation.CREATED, this); OLiveQueryHookV2.addOp(doc, ORecordOperation.CREATED, this); } callbackHooks(ORecordHook.TYPE.AFTER_CREATE, id); }
public void afterDeleteOperations(final OIdentifiable id) { if (id instanceof ODocument) { ODocument doc = (ODocument) id; OImmutableClass clazz = ODocumentInternal.getImmutableSchemaClass(this, doc); if (clazz != null) { OClassIndexManager.checkIndexesAfterDelete(doc, this); if (clazz.isFunction()) { this.getSharedContext().getFunctionLibrary().droppedFunction(doc); Orient.instance().getScriptManager().close(this.getName()); } if (clazz.isOuser() || clazz.isOrole()) { getMetadata().getSecurity().incrementVersion(); } if (clazz.isSequence()) { ((OSequenceLibraryProxy) getMetadata().getSequenceLibrary()).getDelegate().onSequenceDropped(this, doc); } if (clazz.isScheduler()) { final String eventName = doc.field(OScheduledEvent.PROP_NAME); getSharedContext().getScheduler().removeEventInternal(eventName); } if (clazz.isTriggered()) { OClassTrigger.onRecordAfterDelete(doc, this); } } OLiveQueryHook.addOp(doc, ORecordOperation.DELETED, this); OLiveQueryHookV2.addOp(doc, ORecordOperation.DELETED, this); } callbackHooks(ORecordHook.TYPE.AFTER_DELETE, id); }