@Override public OResult next() { OResult toCopy = upstream.next(); long begin = profilingEnabled ? System.nanoTime() : 0; try { ORecord resultDoc = null; if (toCopy.isElement()) { ORecord docToCopy = toCopy.getElement().get().getRecord(); if (docToCopy instanceof ODocument) { resultDoc = ((ODocument) docToCopy).copy(); resultDoc.getIdentity().reset(); ((ODocument) resultDoc).setClassName(null); resultDoc.setDirty(); } else if (docToCopy instanceof OBlob) { ORecordBytes newBlob = ((ORecordBytes) docToCopy).copy(); OResultInternal result = new OResultInternal(); result.setElement(newBlob); return result; } } else { resultDoc = toCopy.toElement().getRecord(); } return new OUpdatableResult((ODocument) resultDoc); } finally { if (profilingEnabled) { cost += (System.nanoTime() - begin); } } }
} else { doc.getIdentity().reset(); ODocumentInternal.addOwner(doc, iDocument); ODocumentInternal.addOwner(doc, iDocument);
rec.getIdentity().reset();
public void create(ODatabaseDocumentInternal database) { acquireExclusiveLock(); try { try { save(OMetadataDefault.CLUSTER_INTERNAL_NAME); } catch (Exception e) { OLogManager.instance().error(this, "Error during storing of index manager metadata," + " will try to allocate new document to store index manager metadata", e); // RESET RID TO ALLOCATE A NEW ONE if (ORecordId.isPersistent(document.getIdentity().getClusterPosition())) { document.getIdentity().reset(); save(OMetadataDefault.CLUSTER_INTERNAL_NAME); } } database.getStorage().setIndexMgrRecordId(document.getIdentity().toString()); OIndexFactory factory = OIndexes.getFactory(OClass.INDEX_TYPE.DICTIONARY.toString(), null); createIndex(DICTIONARY_NAME, OClass.INDEX_TYPE.DICTIONARY.toString(), new OSimpleKeyIndexDefinition(factory.getLastVersion(), OType.STRING), null, null, null); } finally { releaseExclusiveLock(); } }
inputDocument.getIdentity().reset();