Lets say I have query that gets following List Item Objects with Set of tags like this:
Item1{TagSet{tag1,tag2,tag3}}
Item2{TagSet{tag3,tag4,tag5}}
Item3{TagSet{tag6,tag7,tag8}}
Item1 Item2 Item3 are instances of Item object in List
TagSet is Set Collection object
What HQL or SQL query would retrieve the List of Items having tag3 and from that result get list of all tags from thouse items that contain tag3 (not including tag3) eg. from the 3 items above?
Desired result would be:
TagSet{tag1, tag2, tag4, tag5}
You didn’t give us your schema, so I’m guessing here, but…
SQL:
HQL:
Then use tag.getItem() to get the Items for the tags returned.