When you write an XPath constraint that crosses an association from a local to an external entity, you are met with the following error;
Cannot use association 'MyModule.Persistent_External' in an XPath constraint, because it is an association from a local entity to an entity from 'MyModule.ODataConsumed'.
Sure, most of the times this is understandable. We don't want to combine a database query with an OData query, that would be messy and impractical.
However, this is not the case for the following XPath constraint.. but studio pro won't allow it;
[not(MyModule.Local_External/MyModule.External)]
This is unfortunate, because it forces me to either;
- Keep track of the association with a boolean 'IsAssociated' (error prone)
- Retrieve all local objects and filter on empty (inefficient)
Implementing this feature should be relatively straightforward, and would make developing apps that rely heavily on mendix connect / datahub more pleasant.