Re: core data subentities
Re: core data subentities
- Subject: Re: core data subentities
- From: Daniel Child <email@hidden>
- Date: Tue, 15 Jan 2008 23:04:04 -0500
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.
_______________________________________________
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