One-To-Many relationship double committing

Suppose I have a data model with Airport->Terminals->Airlines. Airport->Terminal is a composition relationship. Terminal->Airlines is a one-to-many relationship. This implies that an airline can only relate to a single terminal. It isn’t a perfect real world example but let’s go with it. In the attached sample project, I have browser and editor screens for each eantity. The Terminal editor uses a TokenList to seelect the associated Airlines. But every time I create a terminal, whether from the Airport editor or the Terminal browser, and associate airlines to this new terminal, it is trying to double save the new temrinal. I have played with different combinations of views but I cannot figure out how to prevent this from happening. I have some intuition that this is due to the allAirlinesDs and the airlinesDs both including the temrinal attribute into their view. But as I understand it, both need to contain that attribute. Can anyone give some guidance on this? (93.7 KB)

I’m not sure this model will work at all. If you have composition between Airport and Terminals, then the Terminal is not saved to the database immediately when created, but only when you save Airport. So you cannot create Airline for the new Terminal, because Airline record requires a reference to a Terminal in the database, which doesn’t exist yet.