• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Fetch problem fixed by myself :-)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Fetch problem fixed by myself :-) (From: "Oliver Leu" <email@hidden>)

  • Prev by Date: Re: Generate PDF documents
  • Next by Date: Re: WebObjects command line parsing help
  • Previous by thread: Fetch problem fixed by myself :-)
  • Next by thread: New KBase: "Using Java 1.3.1 With Mac OS X After Java 1.4.1 Is Installed"
  • Index(es):
    • Date
    • Thread