SELECT c.id as vcid,
c.hexValue as hv
FROM VisualColor cLEFT JOIN c.dataKontorFolders dkf
LEFT JOIN c.phases p
LEFT JOIN p.bugs b
LEFT JOIN b.reporteds bugrep
LEFT JOIN bugrep.project.projectgroup.ownedByOrganizations brownorg
WHERE 1=1 OR
dkf.dataKontor.dataKontorUsergroup.organization = :o