0

I have a Host which has a many-to-many relationship with services. The relation is through a join table "hostServices". I would like to fetch te services related to a Host via a "fetched property". But how do I define the predicate?

I now did something like 'ANY hostServices.host.name == "$FETCH_SOURCE.name"' and I have tried 'ANY hostServices.host == "$FETCH_SOURCE"'.

But that didn't work. Does anyone know how I could fetch the services?

Thanks in advance!

My data model

Leon
  • 841
  • 3
  • 10
  • 21

1 Answers1

1

Try:

host == $FETCH_SOURCE
Chris Gummer
  • 4,772
  • 1
  • 24
  • 17
  • Ow, wait. I made it an expression. But then I get: keypath host not found in entity ' – Leon Nov 07 '10 at 21:46
  • This doesn't work: ANY hostServices.host.name == "$FETCH_SOURCE.name" But this does: ANY hostServices.host.name == "bimbo.ping.uio.no" Should I do something with FETCH_SOURCE? – Leon Nov 07 '10 at 21:56
  • Have you specified the Host entity with an inverse relationship on the HostService entity? Perhaps you could post your data model? – Chris Gummer Nov 07 '10 at 22:00
  • Hi Chris, I misread your answer. I had to ditch the quotes. So your suggestion worked perfectly! Thanks! This was the correct setting: http://i.imgur.com/pLSuO.png – Leon Nov 07 '10 at 22:06