Skip to content

Commit

Permalink
fix: make sure to load the record from the database in toElement if t…
Browse files Browse the repository at this point in the history
…he result has a @Rid field, issue #10268
  • Loading branch information
tglman committed Sep 27, 2024
1 parent 1ee0396 commit 0c82fc9
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.orientechnologies.orient.core.sql.executor;

import com.orientechnologies.orient.core.db.ODatabaseDocumentInternal;
import com.orientechnologies.orient.core.db.ODatabaseRecordThreadLocal;
import com.orientechnologies.orient.core.db.record.OIdentifiable;
import com.orientechnologies.orient.core.id.OContextualRecordId;
import com.orientechnologies.orient.core.id.ORID;
Expand Down Expand Up @@ -294,6 +295,10 @@ public OElement toElement() {
if (isElement()) {
return getElement().get();
}
if (hasProperty("@rid") && ODatabaseRecordThreadLocal.instance().isDefined()) {
ODocument doc = ODatabaseRecordThreadLocal.instance().get().load((ORID) getProperty("@rid"));
return doc;
}
ODocument doc = new ODocument();
for (String s : getPropertyNames()) {
if (s == null) {
Expand Down

0 comments on commit 0c82fc9

Please sign in to comment.