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

Re: (no subject)


  • Subject: Re: (no subject)
  • From: Art Isbell <email@hidden>
  • Date: Mon, 6 Feb 2006 14:18:27 -1000

On Feb 6, 2006, at 1:15 PM, Scott Winn wrote:

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)

You could filter the company.sellers() array:

EOQualifier qualifier = new EOKeyValueQualifier("seller_code", EOQualifier.QualifierOperatorLike, company.sourceCode());
NSArray sellers = EOQualifier.filteredArrayWithQualifier (company.sellers(), qualifier);


But this would result in all Sellers of the current Company being fetched if they haven't already been.

	Or you could fetch just the Sellers that satisfy the criteria:

NSDictionary values = new NSDictionary(new Object[] {company, company.sourceCode()}, new String[] {"company", "sellerCode"});
NSArray sellers = EOUtilities.objectsMatchingValues(editingContext, "Seller", values);


Aloha,
Art

_______________________________________________
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


References: 
 >(no subject) (From: Scott Winn <email@hidden>)

  • Prev by Date: Re: (no subject)
  • Next by Date: EOModeler and OpenLDAP
  • Previous by thread: Re: (no subject)
  • Next by thread: (no subject)
  • Index(es):
    • Date
    • Thread