Building a TYPO3 extension in Extbase/Fluid

Query constraint for an m:n-related domain model

see my stackoverflow question on this with a working but not satisfactory solution