mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 15:19:59 +07:00
[platform] Use upsert instead of handmade check for entity existence
GitOrigin-RevId: 0f8da0b94d763d699c6768e755f6847599e5e615
This commit is contained in:
committed by
intellij-monorepo-bot
parent
e30be0c48b
commit
355cbae734
@@ -47,14 +47,8 @@ abstract class ProjectEntitiesStorage {
|
||||
If it happens that the entity has not been found and the frontend creates a new one, Rhizome DB will perform a "rebase"
|
||||
which basically re-invokes the whole "change" block either on the backend or the frontend side.
|
||||
*/
|
||||
val existing = entity<ProjectEntity, ProjectId>(ProjectEntity.ProjectIdValue, projectId)
|
||||
if (existing != null) {
|
||||
existing
|
||||
}
|
||||
else {
|
||||
ProjectEntity.new {
|
||||
it[ProjectEntity.ProjectIdValue] = projectId
|
||||
}
|
||||
ProjectEntity.upsert(ProjectEntity.ProjectIdValue, projectId) {
|
||||
it[ProjectEntity.ProjectIdValue] = projectId
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user