Coredata Abstract Relations
Coredata Abstract Relations
- Subject: Coredata Abstract Relations
- From: Sammi Williams <email@hidden>
- Date: Sun, 26 Jun 2005 04:44:01 +1200
Hello
I have a simple program for managing account information. There are
two kinds of transactions, a PersonTransaction and a BankTransaction,
both inheriting from the abstract entity Transaction.
The Bank entity has a to-many (and inverse) relation to instances of
BankTransaction, and also a number of PersonAccounts. A person
account has a number of PersonTransactions.
My question is simply, how can the bank get every single Transaction
associated with it - this includes all its direct BankTransactions,
and also all its PersonTransactions indirectly related to it through
a PersonAccount.
Currently, I've been messing about with a fetched property, without
much luck.
Please help, I've spent at east 5 hours messing about on this. I did
eventually come up with a predicate that looked something like 'bank
= $FETCH_SOURCE' - and I implemented a subclass of NSManagedObject
for PersonTransaction that would return the bank associated with it -
ie PersonTransaction.PersonAccount.Bank.
Is there any way to use @distinctUnionOfSets to do this? Or could I
make a obj-c subclass and add some kind of method that returns a set
of all the transactions programatically? I've been browsing the
documentation _a lot_, but I cannot seem to find answers for most of
these questions.
Another small question is how do you define abstract properties that
should be overridden in subclasses? Can you have some kind of
abstract relationship which could either be directly coded in a
subclass, or made a fetched property in a subentity? What is the
point of an abstract class? Do relations for an abstract class get
managed?
Also, just something I've been curious about via the xcode interface
- what are 'Configurations' - as in 'General, User Info,
Configurations', and what is the difference between a fetched
property and a fetch request? Is a fetch request a global thing?
Please help me because its driving me insane and its already 5am.
THANKS!!
Sammi Williams
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden