Hi there,
a qualifier should be independent on ECs and work just as well in any of them,
right? Well, wrong :( If there's a key-value (sub-)qualifier like this:
===
def qq=EOQualifier.qualifierWithQualifierFormat("aRelationship=%@",new
NSArray(someEO))
===
then I can reliably fetch using this qualifier in any EC (since it translates
to simple check of the FK SQL-side), but I cannot use this qualifier in any
other EC to evaluate, for it does not work, like this:
===
def anotherEC=ERXEC.newEditingContext()
def eos=anotherEC.objectsWithFetchSpecification(new
EOFetchSpecification('ProperEntity',qq,null)) // fetches all right, this works
like a charm
for (eo in eos) println "matches: "+qq.evaluateWithObject(eo) // none matches
though
===
All the objects report “matches: false”, for self-evidently, in-memory
evaluation instead of comparing the FK directly compares the objects. Sigh.
Isn't there a trick to make a truly EC-agnostic qualifier? I've tried to
replace each KeyValue(relName,same,eo) by appropriate
KeyValue(relFKAttributeName,same,eo.rawPrimaryKey), but that fails, since
EOKeyValueQualifier can't work with attributes which are not class properties :(
Can anybody see a reasonable work-around?
Thanks!
OC _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com
This email sent to [email protected]