Skip to content

Commit

Permalink
Merge pull request #214 from JetBrains/XD-1146
Browse files Browse the repository at this point in the history
Fix of issue #XD-1146, correct calculation of oEntityId
  • Loading branch information
andrii0lomakin authored Nov 1, 2024
2 parents e6b46f8 + a9f2786 commit 6f13cf1
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,18 @@ open class OVertexEntity(vertex: OVertex, private val store: OEntityStore) : OEn
}

private var vertexRecord: OVertex
private var oEntityId: ORIDEntityId

init {
vertexRecord = vertex
val v = if (vertex.isUnloaded) {
val session = store.requireActiveTransaction()
session.bindToSession(vertex)
} else {
vertex
}

oEntityId = ORIDEntityId.fromVertex(v)
vertexRecord = v
}

val vertex: OVertex
Expand All @@ -97,7 +106,6 @@ open class OVertexEntity(vertex: OVertex, private val store: OEntityStore) : OEn
val isUnloaded: Boolean
get() = vertexRecord.isUnloaded

private var oEntityId = ORIDEntityId.fromVertex(vertex)

override fun getStore() = store

Expand Down

0 comments on commit 6f13cf1

Please sign in to comment.