• 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
(no subject)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

(no subject)


  • Subject: (no subject)
  • From: Scott Winn <email@hidden>
  • Date: Mon, 6 Feb 2006 15:15:46 -0800

Hello WO Gurus, 

I need a good example of how to search my EOModeled database using relationships.  Both of the books I have purchased have remarkably little to say on the subject.  Here are the entities and their relevant attributes. . . 

Company
(PK) company_id
Relationship: Sellers (to Many)

Seller
(PK) seller_id
(FK) seller_company_id
seller_code
Relationship: Company (to One)

My code successfully gets a Company object from the database (referred to as import_Company below). It also retrieves a String called source_code to compare with the Seller object's seller_code to help narrow the search.  

What I want is essentially an object from Seller where (seller_company_id == import_Company.company_id) and (seller_code == source_code)

I have looked high and low for an example of the "WebObjects Way" to do this.  Most all of the specific EOQualifier and FetchSpec examples are about following a relationship to some value employee.department.name etc.  I was good and did NOT include Primary or Foreign Keys accessors in my Java Class files.

I could do NSArray SellerArray = (NSArray)import_Company.Sellers();  and then search each array element for the source_code == seller_code match I'm looking for, but there must be a better way.  I have tried to adapt some of the examples I managed to find, but naming conventions were not good enough to help me figure out if they were passing relationships or something else.  I have tried filteredArrayWithQualifier and objectMatchingValues with no success.  

Thanks for bailing out the newbie, 

Scott
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: (no subject)
      • From: Art Isbell <email@hidden>
    • Re: (no subject)
      • From: wojingo <email@hidden>
    • Re: search my EOModeled database using relationships.
      • From: Arturo Pérez <email@hidden>
    • Re: (no subject)
      • From: Michael Warner <email@hidden>
  • Prev by Date: Re: MySQLPlugIn.MySQLExpression bug?
  • Next by Date: Re: (no subject)
  • Previous by thread: Re: D2WQuery and Rules Question
  • Next by thread: Re: (no subject)
  • Index(es):
    • Date
    • Thread