-
Notifications
You must be signed in to change notification settings - Fork 114
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
Delete links with indices #187
Conversation
…do not have a single test for this logic
@kirillvasilenko can you answer my questions? |
@andrii0lomakin, sure. As soon as you ask them :) ![]() |
@andrii0lomakin, it seems distributed anomalies in action. I will answer you here as I do not have those questions on my side :)
Normally, it should not be possible. But if we delete an edge when the complementary property has already been created but has not been initialized, it is possible.
Yeah, I tried, the tests work. I kept this save() because of the "not save() phobia" I got while working with Orient. If you prefer me to remove that operator, no problem, only say. |
|
@andrii0lomakin, you got it. Now, additionally to the "not saved()" phobia, I have the "saved() but may be recreated" phobia :(( |
private fun OVertex.deleteTargetEntityIdIfLinkIndexed(linkName: String, targetId: ORID) { | ||
val linkTargetEntityIdPropertyName = linkTargetEntityIdPropertyName(linkName) | ||
if (requireSchemaClass().existsProperty(linkTargetEntityIdPropertyName)) { | ||
val bag = getProperty<ORidBag>(linkTargetEntityIdPropertyName) ?: ORidBag() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How is it possible that ridbag will not exist in this case? Is it not a bug?
|
||
val edge = findEdge(edgeClassName, target.vertex.identity) | ||
edge?.delete() | ||
edge?.save<OEdge>() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you try not to save the deleted edge? It looks like, using this approach, we risk recreating them instead of deleting them.
Fixed OVertexEntity.deleteLink() and Co, OVertexEntity.setLink() and Co. Added tests.