I have an object named Guy that has a girlfriend attribute type Key []
Given the list of Longs that are Girl identifiers, I want to ask all the guys who have one of these girls as a girlfriend.
For example (Guy: gilfriends):
LuckyGuy: {a,b,c}
Guy1: {b}
Guy2: {c}
I want g, for example:
g({a,b}) = LuckyGuy, Guy1
g({c})) = LuckyGuy, Guy2
I could do a loop:
for(i..n)
resultSet.add(
objectifyFactory.begin().load().type(User.class).filter("girlfriends", girlfriendId[i])
);
But I'm sure there is a direct strategy.
Any idea?
source
share