Ok, i think i do the migration manually. Thanks for the reply.
It seems that the automatic mapping for core data models is not as good as it could be, especially for complex data models.

Sam


Am 17.01.2009 um 08:13 schrieb Quincey Morris:

On Jan 16, 2009, at 21:00, Sean McBride wrote:

Quincey Morris (quinceymor...@earthlink.net) on 2009-01-16 6:53 PM said:

The bad news is that abstract entities will cause
NSPersistentDocument's Save As to break, since it apparently uses a
Core Data migration to implement Save As, with an auto-generated
mapping model, which of course fails to copy the inherited
relationships properly. (My solution was to stop using abstract
entities in the next version of the data model. :) )

Do you have any more info on this?  In what way does 'save as' break?
This sounds like a huge bug.  Has it been so since 10.4.0?  Is the
problem only with relationships from the abstract superentity?

I don't have a lot more info. All my Core Data development has been on Leopard, so I don't know about the Tiger behavior.

By "break" I mean that Save As failed at the end, with a log message. The error message made me think about the abstract entity migration issue, so when I next had a chance I eliminated the abstract entities, and after that Save As worked just fine.

... I just tried modifying the OutlineEdit Core Data sample program to use an abstract entity, and it does *not* fail on Save As.

... And I just tried rebuilding that old version of the app, and it still fails. The log error message is:

The temporary directory at "/private/var/folders/.../TemporaryItems/ (A Document Being Saved By MyApp)" could not be deleted.

In addition, the Save As returns an error which is displayed as a document sheet. It's an array of 46 validation errors. At the time I wrote code to coalesce the error descriptions, so it actually says:

        46 validation errors have occurred:
        1. parent is not valid.
        2. parent is not valid.
        3. listableItems is not valid.
        (43 additional errors not shown)

'parent' and 'listableItems' are properties of the abstract parent entity. I believe I once checked that all of the errors related to the inherited properties. Incidentally, the document wasn't dirty at the time of the Save As, and plain Save always works.


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/strupp%40synium.de

This email sent to str...@synium.de

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to