retrieve from database where association is empty

0
I am intentionally creating a bunch of orphan entities and want to later retrieve them later. How do I go about doing it? XPath constraint does not take empty argument for association. Association does not show up in a decision box expression. Is there some other clever way?
asked
2 answers
13

You can use a not in your XPath.

For example, consider this relationship...

If I want to retrieve all the A’s without an association to B in MyFirstModule. I would retrieve MyFirstModule.A with the XPath constraint of 

[not(MyFirstModule.A_B/MyFirstModule.B)]


Hope this helps.

answered
4

You can use [not(Entity1_Entity2/Entity2)]. This finds all object of Entity1 that do not have an association to an object of Entity2.

 

Note that a not() operator over an association is a relatively heavy operation for a database.

answered