@Override protected ODocument preprocess(ODocument result) { return result.copy(); }
void bindOnLocalThread() { if (tlDocument.get() == null) { tlDocument.set(document.copy()); } }
@Override public <RET extends ORecord> RET copy() { return (RET) new OVertexDelegate(element.copy()); }
@Override public OEdge copy() { if (element != null) { return new OEdgeDelegate(element.copy()); } else { return new OEdgeDelegate(vOut, vIn, lightweightEdgeType, lightwightEdgeLabel); } }
private Object copy(final ODocument document, final Object[] iFieldNames) { final ODocument doc = document.copy(); for (Object iFieldName : iFieldNames) { if (iFieldName != null) { final String fieldName = iFieldName.toString(); if (fieldName.endsWith("*")) { final String fieldPart = fieldName.substring(0, fieldName.length() - 1); final List<String> toExclude = new ArrayList<String>(); for (String f : doc.fieldNames()) { if (f.startsWith(fieldPart)) toExclude.add(f); } for (String f : toExclude) doc.removeField(f); } else doc.removeField(fieldName); } } doc.deserializeFields(); return doc; }
public void createdFunction(ODocument function) { ODocument metadataCopy = function.copy(); final OFunction f = new OFunction(metadataCopy); functions.put(metadataCopy.field("name").toString().toUpperCase(Locale.ENGLISH), f); onFunctionsChanged(ODatabaseRecordThreadLocal.instance().get()); }
public static void notifyForTxChanges(ODatabaseDocument database) { if (Boolean.FALSE.equals(database.getConfiguration().getValue(QUERY_LIVE_SUPPORT))) return; OLiveQueryOps ops = getOpsReference((ODatabaseInternal) database); List<OLiveQueryOp> list; synchronized (ops.pendingOps) { list = ops.pendingOps.remove(database); } // TODO sync if (list != null) { for (OLiveQueryOp item : list) { item.originalDoc = item.originalDoc.copy(); ops.enqueue(item); } } }
public void updatedFunction(ODocument function) { reloadIfNeeded(ODatabaseRecordThreadLocal.instance().get()); ODocument metadataCopy = function.copy(); OCallable<Object, Map<Object, Object>> callBack = null; OFunction oldFunction = functions.get(metadataCopy.field("name").toString()); if (oldFunction != null) { callBack = oldFunction.getCallback(); } final OFunction f = new OFunction(metadataCopy); if (callBack != null) { f.setCallback(callBack); } functions.put(metadataCopy.field("name").toString().toUpperCase(Locale.ENGLISH), f); }
public ODocument toNetworkStream() { ODocument document = new ODocument(); internalAcquireExclusiveLock(); try { document.setInternalStatus(ORecordElement.STATUS.UNMARSHALLING); try { final OTrackedSet<ODocument> indexes = new OTrackedSet<>(document); for (final OIndex<?> i : this.indexes.values()) { indexes.add(((OIndexInternal<?>) i).updateConfiguration().copy()); } document.field(CONFIG_INDEXES, indexes, OType.EMBEDDEDSET); } finally { document.setInternalStatus(ORecordElement.STATUS.LOADED); } document.setDirty(); return document; } finally { internalReleaseExclusiveLock(); } }
@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); } } }
indexesToRebuild = new ArrayList<>(); for (ODocument index : knownIndexes) indexesToRebuild.add(index.copy()); // make copies to safely iterate them later
if (fieldValue instanceof ODocument && ((ODocument) fieldValue).isEmbedded()) { return ((ODocument) fieldValue).copy(); } else if (fieldValue instanceof ORidBag) { ORidBag newBag = ((ORidBag) fieldValue).copy();
throw new ORecordNotFoundException(getIdentity(), "The vertex " + getIdentity() + " has been deleted"); final ODocument doc = ((ODocument) getRecord()).copy();
throw new ORecordNotFoundException(getIdentity(), "The vertex " + getIdentity() + " has been deleted"); final ODocument doc = ((ODocument) getRecord()).copy();
graph.throwRecordNotFoundException(getIdentity(), "The vertex " + getIdentity() + " has been deleted"); final ODocument doc = ((ODocument) rawElement.getRecord()).copy();