Instance name of related transient entity disappears in gui

My application has two data stores. One of the data stores contains reference data from another database schema, and the other data store holds the applications working data. I’ve imported entities from the reference data store that I’m using as related attributes in entities from the working data store. When I add the reference entities as attributes, they are marked transient and the ORM marks those id fields as “related attributes” and creates a field in the new entity to store the ID. So far, so good.

The issue I’m having is that the instance name of the new entity needs to show the instance name of the entity attribute from the other data store in the Gui. When I select the referenced entity in the Edit screen it disappears, probably because it is transient. How do I make it so that the instance name always shows in the view?

More concretely, I have a client entity from the other data store. I’ve created a new entity, FollowUpClient, that has the client as an attribute. I’d like users to see the client’s instance name, firstName + lastName, in the gui screen, but it keeps disappearing in the gui.

I was able to work around the issue by creating an entity listener that saves the transient fields into the entity. See below:

public void onBeforeInsert(FollowUpClient entity, EntityManager entityManager) {