I tried to find some entities where a relation (relation) is null or a specific attibute of a related entity is x:
SELECT o FROM MyObject o WHERE (o.relation is empty) OR ((o.relation is not empty) AND (o.relation.attribute LIKE 'x'))
select ... where ... not (exists (select ...)) or (exists (select ...)) and (...attribute like 'x'))
For everyone with the same problem (and the same less expirience as me ;-)):
Selecting all entities and then using
member ofworked for me.