Re: Fetching from related object
Re: Fetching from related object
- Subject: Re: Fetching from related object
- From: David LeBer <email@hidden>
- Date: Fri, 23 Apr 2004 19:27:52 -0400
Is there a relationship from the log objects to the customer objects?
Then you can create a fetch spec in EOModeler that matches the customer
OBJECT, and not it's pk.
On 23-Apr-04, at 6:54 PM, Randall Perry wrote:
I'm using a Direct Action to do fetches for customer login. Have one
fetch
working successfully, which fetches the customer record given the
userName
and passWord:
EOQualifier qual = EOQualifier.qualifierWithQualifierFormat("userName
= '" +
userName + "' and password = '" + passWord + "'", null);
EOFetchSpecification custFetchSpec = new
EOFetchSpecification("CustView",
qual, null);
custInfo = ec.objectsWithFetchSpecification(custFetchSpec);
Went to add a second fetch which grabs log entries for the past year by
joining on custNo:
qual = EOQualifier.qualifierWithQualifierFormat("custNo = '" +
custInfo.custNo() + "' and dateTime > '" + dateOneYearAgo, null);
EOFetchSpecification logFetchSpec = new
EOFetchSpecification("CustView",
qual, null);
logInfo = ec.objectsWithFetchSpecification(logFetchSpec);
Then I realized that custNo is a hidden key in EOModeler for both
entities,
so this can't be done without making the keys visible.
There is a to-one relationship defined in EOModeler between the Log and
CustView entities.
How would I do the logInfo fetch above without making the keys visible?
--
Randall Perry
sysTame
Xserve Web Hosting/Co-location
Website Development/Promotion
Mac Consulting/Sales
http://www.systame.com/
_______________________________________________
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.
;david
--
David LeBer
Codebase Software Systems
site: http://www.codebase.ca
blog: http://david.codebase.ca
_______________________________________________
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.