Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate id method was fixed. #238

Merged
merged 1 commit into from
Jan 16, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,7 @@ import com.jetbrains.youtrack.db.internal.core.id.RecordId
import com.jetbrains.youtrack.db.internal.core.record.RecordAbstract
import com.jetbrains.youtrack.db.internal.core.record.impl.RecordBytes
import jetbrains.exodus.ByteIterable
import jetbrains.exodus.entitystore.Entity
import jetbrains.exodus.entitystore.EntityId
import jetbrains.exodus.entitystore.EntityIterable
import jetbrains.exodus.entitystore.EntityRemovedInDatabaseException
import jetbrains.exodus.entitystore.*
import jetbrains.exodus.entitystore.orientdb.OVertexEntity.Companion.CLASS_ID_CUSTOM_PROPERTY_NAME
import jetbrains.exodus.entitystore.orientdb.OVertexEntity.Companion.LOCAL_ENTITY_ID_PROPERTY_NAME
import jetbrains.exodus.entitystore.orientdb.OVertexEntity.Companion.linkTargetEntityIdPropertyName
Expand Down Expand Up @@ -140,6 +137,7 @@ open class OVertexEntity(vertex: Vertex, private val store: OEntityStore) : OEnt

override fun generateId() {
val type = oEntityId.getTypeName()
vertexRecord = store.currentTransaction!!.asOStoreTransaction().bindToSession(vertexRecord)
store.requireActiveTransaction().generateEntityId(type, vertexRecord)
oEntityId = ORIDEntityId.fromVertex(vertexRecord)
}
Expand Down Expand Up @@ -571,9 +569,5 @@ fun Vertex.requireLocalEntityId(): Long {
?: throw IllegalStateException("localEntityId not found for the vertex")
}

fun OVertexEntity.asReadonly(): OReadonlyVertexEntity {
return OReadonlyVertexEntity(vertex, store as OPersistentEntityStore)
}


val String.asEdgeClass get() = OVertexEntity.edgeClassName(this)
Loading