How to retrieve non-persistent entity without associations
I've a challenge of retrieve the grandparent dataview object from within the grandchild datagrid. Parent dataview entity A - is a persistent entity, Child datagrid entity B - is a non-persistent entity from a web-service API domain model. GrandChild datagrid entity C- is another non-persistent entity also from the web-service API domain model. There are no associations between these three entities. However I want to attach selected objects of the datagrid C onto entity A using a button in datagrid C. One of the solutions would be introduce non-persistent entity D to store the Id of A, then using java I retrieve the 1st object in D and then delete the objects from D (for consistence in next retrieval). How can can this be achieved with mendix? Also any other solutions are welcome.
Normally when a non-persistable entity is not referenced anymore by anything that is reachable in either the server (including being explicitly added to the session by java actions) or the client, it would just get garbage-collected. Since you're saying you don't even have associations, I'm having a hard time painting the picture of how your application is looking like and what you want to achieve or if it is the right way to approach things. Maybe you could elaborate?
Sebastiaan van den Broek
I managed to get a solution.
Since webserviceAPI domain models are not accessible to create a relationship with persistent entity A, I created another non-persitent entity (D) in A's domain model and associated it to the persistent entity A. I copied relevant content from entity B into D via microflow.
Now the datagrid of entity B has entity D as the datasource via microflow.
This solved my problem. Thanks @Broek for the feedback about garbage collection.