@composition: Is there a way to let the child edit screen itself decide its behavior regarding saving?

I have two entities Parent and Child with a composition. Also created default edit screens.

@JmixEntity
@Table(name = "PARENT")
@Entity(name = "Parent")
class Parent {
    @JoinColumn(name = "PROP_ID")
    @Composition
    @OneToMany(mappedBy = "parentField")
    var property: Child? = null
}
----
@JmixEntity
@Table(name = "CHILD")
@Entity(name = "Child")
class Child {
     ...
}

I would like the Child edit screen to be saved independently from the parent edit screen (with two independent dataContext).
Removing the @composition does the job but the 2 entites have a composition relation in terms of relational DB.
Meanwhile I think I prefer that the child screen itself choose to save or not. Not having the entity decide for the screen behavior. I may need multiple screens on the same entity with different saving behaviors in the future.
So I tried to remove the parent dataContext in the childScreen to make it independent but I got an exception.

    @Subscribe
    private fun onInit(event: InitEvent) {
        dataContext.parent = null
    }

Is there a correct way to let the child edit screen itself decide its behavior regarding saving ?
I try to keep a simple code as much as I can. I could maybe open the screen programmatically and not call .withParentDataContext() but it would not be a proper solution to implement all throughout the app.

Hi,

The idea of composition is to save child entities with the parent and remove them when parent is removed. If you want to edit child entities independently and only keep “removing” functionality then it seems that the simplest solution is to change Composition to Association and define the following in the child entity for the parent attribute:

Screenshot 2023-12-08 at 12.29.38

The same set by default in case of composition.

Regards,
Gleb