Re: CoreData - multiple stores advice...
Re: CoreData - multiple stores advice...
- Subject: Re: CoreData - multiple stores advice...
- From: Martin Linklater <email@hidden>
- Date: Tue, 29 Jan 2008 06:57:54 -0800
On Tuesday, January 29, 2008, at 01:06PM, "mmalc crawford" <email@hidden> wrote:
>Per the original reply, you can only have one MOM per coordinator. So
>you can't directly do what you're asking. That's why it's not
>documented.
Understood. Is this explicitly stated in the documentation anywhere ? If not I will file an enhancement request... it would reduce confusion for newbs like myself.
>> I could always create the NSPersistentStores myself using
>> [NSPersistentStore initWithPersistentStoreCoordinator], but then I
>> need to pass in a 'managed object model configuration' - what's
>> this ? I have my managed object models - what is the 'configuration'
>> bit ?
>>
>"A configuration is a named collection of entities in the model."
><http://developer.apple.com/documentation/Cocoa/Conceptual/CoreData/Articles/cdMOM.html
> >
>and
><http://developer.apple.com/documentation/DeveloperTools/Conceptual/XcodeUserGuide/Contents/Resources/en.lproj/02_40_design_data_modeling/chapter_17_section_4.html
Thank you - I had missed that. My apologies.
>If you want to have different entities in different stores, you have
>to create a model that's a superset of all the entities you're going
>to deal with and that defines the subsets as configurations. For each
>individual store, you specify the configuration.
Ah - so let me see if I understand this.... What I want is to have separate stores for each of my datamodels. I can do this by:
Creating configurations in my datamodel files. In my case all the entities in each datamodel would be part of the same configuration.
Create a single, merged MOM from all my datamodel files.
Use this MOM to create an NSPersistentStoreCoordinator
Add my stores through the coordinator, specifying the different physical store attributes by configuration.
Is that correct ?
Thanks.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden