Skip navigation.
 
mlRe: core data subentities
FROM : Daniel Child
DATE : Wed Jan 16 05:04:04 2008

I am trying to picture how the data gets stored. Is it one file or 
three? Can I search the superentity on one of its fields and end up 
with a result set containing data from both subentities? (Presumably 
yes, but that would NOT necessarily be the case with the class-
subclass model: depends how you store what. => I don't see that they 
are necessarily "the same.")

And to be able to search exclusively one type of subentity, or return 
all of the subentity objects of one type, do I need a superentity 
attribute called "recordType" (or whatever is appropriate for the 
type of entity). (again my guess is "yes") i.e.

SUPERENTITY
fieldOne
fieldTwo
recordType (= {SUBONE or SUBTWO})

SUBONE
fieldThree
fieldFour

SUBTWO
fieldFive
fieldSix

Or is there something about Core Data's handling of the parent-child 
relationship that automatically enables you to search for all records 
of type SUBONE without creating the recordtype field?

All of the storage details matter to me because my sources will be of 
different types: some flat files, some XML, some whatever. The nature 
of what's inside the different subentities may be quite different, 
and they will only have a few critical fields in common.

I've tried to read the documentation, but somehow these answers 
(which I should know before I decide whether to bother getting into 
the nitty gritty of Core Data), don't seem to be there in the summaries.

On Jan 11, 2008, at 4:41 PM, mmalc crawford wrote:

> On Jan 11, 2008, at 12:29 PM, Daniel Child wrote:
>

>> The second is conceptual. If I am going to be importing data 
>> corresponding to type SubOne, and then supplementing that with 
>> data from SubTwo, how exactly does that work. Is a SubOne object a 
>> SuperEntity with an additional attribute?
>>

> It's not clear what the difficulty is.  Entity inheritance is like 
> class inheritance...
> Replace "entity" with "class" and you're pretty much there.

Related mailsAuthorDate
mlcore data subentities Daniel Child Jan 11, 21:29
mlRe: core data subentities mmalc crawford Jan 11, 22:41
mlre: core data subentities Ben Trumbull Jan 12, 01:37
mlre: core data subentities mmalc crawford Jan 12, 22:06
mlre: core data subentities mmalc crawford Jan 12, 22:08
mlRe: core data subentities Daniel Child Jan 16, 05:04