Hi,
In my iOS app I'm loading an sqlite file from the app bundle into core data. This works perfectly fine, however, I want to know how i can add a many-to-many relationship in an SQL statement so i can populate my Database with the correct relationships. Let me explain a bit further.
I have two Entity's in my Core Data model. House and Owner. These two classes have a many-to-many relationship, so a House can have many Owners and a Owner can have many Houses.
I have set up the data model with the appropriate relationships, however, I'm not sure how to create the link in an SQL Statement.
With a one to many relationship I would simply add the Z_PK of the House row to the Z_OWNER column which would mean the house belongs to this owner. But how can I add a group of owners? something along the lines of {x, y, z} in the Z_OWNER column which would state the the Z_PK x,y&z (from the Houses entity) are the owners of this house and vice versa?
I hope you can help me
Thanks in advance!
KrayzieKray
In my iOS app I'm loading an sqlite file from the app bundle into core data. This works perfectly fine, however, I want to know how i can add a many-to-many relationship in an SQL statement so i can populate my Database with the correct relationships. Let me explain a bit further.
I have two Entity's in my Core Data model. House and Owner. These two classes have a many-to-many relationship, so a House can have many Owners and a Owner can have many Houses.
I have set up the data model with the appropriate relationships, however, I'm not sure how to create the link in an SQL Statement.
With a one to many relationship I would simply add the Z_PK of the House row to the Z_OWNER column which would mean the house belongs to this owner. But how can I add a group of owners? something along the lines of {x, y, z} in the Z_OWNER column which would state the the Z_PK x,y&z (from the Houses entity) are the owners of this house and vice versa?
I hope you can help me
Thanks in advance!
KrayzieKray