[Newbie] Using FetchSpecs
[Newbie] Using FetchSpecs
- Subject: [Newbie] Using FetchSpecs
- From: Lucas Haley <email@hidden>
- Date: Fri, 30 Apr 2004 14:57:55 -0700
Heya all --
So I've been trying to use fetch specs with bound qualifier variables,
and I'm a little stuck. I've created a fetchSpec in EOModeler, and used
two variables $username and $password. I then dragged the fetchSpec
into WebObjects Builder (a very undocumented feature), and bound the
variables to the values of two WOTextEdit fields.
I guess my question now is whether I need to get a new fetchSpec, as in
the code below, or if I just use the WODisplayGroup created when I
dragged the fetchSpec into Builder.
Thanks for any help!
- Lucas Haley
public WOComponent submit()
{
EOModelGroup modelGroup = EOModelGroup.defaultGroup();
EOFetchSpecification loginFetch;
NSArray results;
EOEditingContext ec = session().defaultEditingContext();
// check if both username and password fields have values
// query the db for the member
loginFetch = modelGroup.fetchSpecificationNamed("login",
"D20members");
results = ec.objectsWithFetchSpecification(loginFetch);
// set the session member
aMember = (D20members)results.objectAtIndex(0);
session.setMember(getAMember());
// return the same page
return null;
}
_______________________________________________
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.