I'm currently implementing persistentStoreEnsemble:globalIdentifiersForManagedObjects: delegate and have a difficulty to decide about what global identifier to provide.
My Core Data model has two entities: book and image.
For book objects, there is no issue, as I should probably return a UUID, which should be stored in a dedicated property of the book.
However, I'm not sure about the global identifier for an image. Note that the image and book entities have one-to-one relationship in the data model, with a 'cascade' delete rule, which means that once a book is deleted, the linked image is deleted as well. So an image cannot exist in the database without being linked to a book.
Based on the above description, I was wondering if should I return NSNull, UUID, or a hash code (calculated at runtime from the image data) as the global identifier for a given image object?
Thanks for any suggestion.