Statement: DELETE Flow AS f WHERE f.flowGroups IS EMPTY is translated to: delete from flow_attribute_value where not exists(select 1 from flow_group_flows f3_0 where f2_0.id=f3_0.flows_id) The error emerges: f2_0.id is not defined, because f2_0 is unknown. It should be translated to: delete from flow_attribute_value where not exists(select 1 from flow_group_flows f3_0 where id=f3_0.flows_id) |