I have 3 tables that represent a many-many relationship.
User->Mapping>Item
Mapping is a simple table with 2 columns user_id and item_id and the generated class contains two instance variables that reference a User class and an Item class. My confusion is trying to determine how to query against the generated Mapping Class. Given a User, how can I get the current collection of Items via the Mapping? What I can't wrap my brain around is how to write a query to query the Mapping table. I guess I could refetch the User object (which has a collection of Mappings), but is that the right way?
Thanks,
Dennis
|