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); }