fun newEntity()

in entity-browser-app/src/main/kotlin/jetbrains/xodus/browser/web/db/StoreService.kt [127:145]


    fun newEntity(typeId: Int, vo: ChangeSummary): EntityView {
        val entityId = transactional { t ->
            val type = store.getEntityType(t, typeId)
            val entity = t.newEntity(type)
            vo.properties.forEach {
                it.newValue?.let {
                    entity.applyValues(it)
                }
            }
            vo.links.forEach {
                it.newValue?.let {
                    val link = getEntity(it.id, t)
                    entity.addLink(it.name, link)
                }
            }
            entity.id.toString()
        }
        return getEntity(entityId)
    }