An example of my data model version 1 looks like this: enter image description here

The cake is eaten by some guests.

In data model version 2 not every guest will eat the same amount of pieces. I want to assign each guest an individual number of pieces: enter image description here

(numberOfPieces could be set to a default of 1 pieces.)

How can that be accomplished? I've implemented a custom mapping model and set a custom policy for the mapping CakeToCake. However, I'm unsure what to do. Does my policy have to implement createRelationshipsForDestinationInstance:entityMapping:manager:error: where I would manually create the PieceOfCake object?

有帮助吗?

解决方案

I think I did the right thing and finally created PieceOfCake in createRelationshipsForDestinationInstance:entityMapping:manager:error:. It works well.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top