Re: Fetch problem fixed by myself :-)
Re: Fetch problem fixed by myself :-)
- Subject: Re: Fetch problem fixed by myself :-)
- From: Art Isbell <email@hidden>
- Date: Tue, 18 Mar 2003 12:01:41 -1000
On Tuesday, March 18, 2003, at 03:25 AM, Oliver Leu wrote:
I found my mistake:
wrong: argsTheme.addObject("Thema.klasse");
right: argsTheme.addObject("klasse.klassenName");
I have two tables:
Classes
Themes
Every Classes-Row can have many records in the 'Themes' entity.
Fetch:
I wanna fetch all Themes where parentTheme is 'null' AND classesFID
Key
matches to a specified Classes Object:
You seem to be falling into the trap of thinking in terms of primary
and foreign keys rather than in relationships. These keys shouldn't be
class properties in most cases so they won't be accessible in your Java
code, but relationship objects will be.
User choosed an Object from that table:
Assume that the component instance variable bound to the Class popup
button's "selection" key is selectedClass.
argsTheme = new NSMutableArray();
argsTheme.addObject(NSKeyValueCoding.NullValue);
argsTheme.addObject("Thema.klasse");
argsTheme.addObject(wholeClassArrayItem.klassenName());
wholeClassArrayItem sounds like a variable that would be bound to the
popup button's "item" key. If so, this would likely be set to the last
Class in the popup button's "list" array rather than the selected Class.
EOQualifier qual =
EOQualifier.qualifierWithQualifierFormat("parentTheme =
%@
AND %@ = %@", argsTheme);
Assuming that Theme.class is a to-one relationship, I think the
following qualifier would work:
EOQualifier qual =
EOQualifier.qualifierWithQualifierFormat("parentTheme = null AND class
= %@", new NSArray(selectedClass));
Aloha,
Art
_______________________________________________
webobjects-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/webobjects-dev
Do not post admin requests to the list. They will be ignored.