IMHO a Record object might just a row from a table presented in a clever way but a cfquery is not equivalent to a Record object. If you used the gateway to query rows with the pk of 4 and got no results, then that's the same as using a cfquery.
Is it not possible for a row to exist when calling the exists() method but to have been deleted before trying to load() it? Shouldn't a Record only be able to represent either a blank new record, or an actual existing record from the db, not some half populated non existent object? "idiom - an individual peculiarity of language." I guess that sums up my feelings about this :D Sorry if I've failed to understand some basic concept here, I'm a longtime cf'er but ORM's are new on me. Cheers, Chris -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Sean Corfield Sent: 31 May 2006 07:11 To: [email protected] Subject: Re: [Reactor For CF] What happens if I ask for a non-existant record ? On 5/30/06, Tom Chiverton <[EMAIL PROTECTED]> wrote: > I talking about the case where you asked for something with primary key 4, and > it is not present. That's not a 'no result search' which I think is what you > were talking about, it's an actual error (maybe you messed up the code to > generate the link someone just clicked on). But with cfquery, you'd do: select * from table where id = 4 and you'd get an empty query back - NOT an error. In Reactor you get an empty record back. That seems pretty consistent to me. Also this is a fundamental idiom for most every ORM out there: loading a non-existent record gives you an empty record. You're supposed to use the exists() method if there's any question - that's the idiom. I think the problem here is that folks are thinking about this problem in an old-school procedural way... -- Sean A Corfield -- http://corfield.org/ Got frameworks? "If you're not annoying somebody, you're not really alive." -- Margaret Atwood -- Reactor for ColdFusion Mailing List -- [email protected] -- Archives at http://www.mail-archive.com/reactor%40doughughes.net/ -- Reactor for ColdFusion Mailing List -- [email protected] -- Archives at http://www.mail-archive.com/reactor%40doughughes.net/

