Skip navigation.
 
mlRe: CoreData - multiple stores advice...
FROM : Martin Linklater
DATE : Tue Jan 29 15:57:54 2008

On Tuesday, January 29, 2008, at 01:06PM, "mmalc crawford" <<email_removed>> 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.

Related mailsAuthorDate
mlCoreData - multiple stores advice... Martin Linklater Jan 25, 13:34
mlRe: CoreData - multiple stores advice... Martin Linklater Jan 25, 14:48
mlRe: CoreData - multiple stores advice... mmalc crawford Jan 25, 17:12
mlRe: CoreData - multiple stores advice... William Turner Jan 25, 17:17
mlRe: CoreData - multiple stores advice... Martin Linklater Jan 29, 13:50
mlRe: CoreData - multiple stores advice... mmalc crawford Jan 29, 14:06
mlRe: CoreData - multiple stores advice... Martin Linklater Jan 29, 15:57
mlRe: CoreData - multiple stores advice... mmalc crawford Jan 29, 16:45
mlRe: CoreData - multiple stores advice... Martin Linklater Jan 29, 18:12
mlRe: CoreData - multiple stores advice... mmalc crawford Jan 29, 18:17