Re: Simple insert?
Re: Simple insert?
- Subject: Re: Simple insert?
- From: Art Isbell <email@hidden>
- Date: Thu, 29 May 2003 16:45:42 -1000
On Thursday, May 29, 2003, at 11:42 AM, Goodbye Bill wrote:
I'm trying to follow the examples that I have from various tutorials to
create very simple membership create/login pages. One page should
simply
check for the existence of the requested username and create the
necessary
entry in the table. Another page should take the standard username and
password combination and be able to authenticate against that table.
Unfortunately, every example I come across shows that I should be
using the
EditingContext against an array of "Member" objects at the application
or
session level.
Is this really how people deal with this type of thing in WebObjects?
Depends on the app. If your app needs to access these members
repeatedly, caching them in an array in the Application or Session
objects reduces database accesses.
Is
there not a way to build this type of simple logic without using large
arrays to contain every member in the database?
Sure. Invoke EOUtilities.objectMatchingKeyAndValue() passing the
username's attribute name as the key and the entered username as the
value. If no object is returned, an EOObjectNotAvailableException
will be thrown. If this exception isn't thrown, an object whose
username attribute's value matches the entered username already exists.
EOUtilities implements a number of popular convenience methods, so
it's a good class to learn.
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.