small medium large xlarge

Back to: All Forums  Core Data
15 Oct 2009, 19:57
Scott Longberry (1 post)

I have an entity that models assets. These are objects that are not changed by the user and once instantiated, do not change (ie. rooms that may be reserved). A user may put together a list of these assets (ie. Reserving several rooms at one time). If I were simply writing SQL, I would have a separate table (room_reservations) that would acts as a join table between the two tables. However, I am a little confused as to how I would model this in Core Data. Would I create another entity to act as a join table? What would the relationships look like?

Thanks for any pointers,


27 Oct 2009, 00:06
Marcus S. Zarra (284 posts)

Core Data handles many-to-many relationships automatically. Just define the relationship between users and rooms as many to many and Core Data will create the join table under the covers.

You must be logged in to comment