objective c - Multiple inverse relationships in Core Data -


I have an organization library which is in two lists of books. It is important that the library will create these two lists of books. keeps. I have a relationship with my library unit which is one for many people in my book unit from each list. Similarly, the book is related to "library", I am facing some problems with erasing my data from the database and I have read that to help with data integrity, I should establish a reverse relationship. In this case however, a book wants to be able to establish an inverse relationship with each list on my library unit. How can I do this?

My first naive idea is to apply relations to both the lists. So a relation of a book is "libraryForList1" and "libraryForList2" so that it is inversion for each relationship. I will never have to mention these properties because, according to core data spec, if I add any one book from the library list, then it automatically takes care of setting the library as the owner of that book. Your "inexperienced first thought" is essentially correct: If your library unit has two to two relation with books (for clarity) relationships owned books and borrowing books ), then your book unit must have an inverse relationship ( owner library and borrowed library ) and Then the core data will make your life easier.

You may also need to think about removing the rules of these relationships: If a book is deleted for some reason, then proprietary library and Borrowed library > possibly affirmation รข ???? That is, both the libraries have removed the book from their lists, removing the library in which books still look like bad thoughts, it may be that owned books and borrowed books Deleting the rules for code> Reject: A library will not be deleted unless the books are for everyone (and deleted from the library).

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -