I'm trying to get my head around this RESTful scenario in Jersey: I have two resources, User and Item, and i want to retrieve all the items connected to a certain user and all the users connected to a certain item. In short, there exists a many-to-many relationship between User and Item.
I came across this RESTful design:
- All the items connected to a certain user:
GET .../users/{user_id}/items
- All the users connected to a certain item:
GET .../items/{item_id}/users
How can I implement this in Jersey? I found this solution, but it's related to sub-resources nested in the root resource, whereas in my case User and Item are both root resources accessible via their own URIs.