When I call load() on a record and no match is found in the database
there is no exception thrown or (as far as I can tell) method to
determine if the record I now have is actually a record in the database.
For example if I do...
<cfset user = ormService.createRecord("user")/>
<cfset user.setUserid(1)/>
<cfset user.load()/>
... and there's no user record with userid=1, I'm left with a user
object that has a userid of 1 and "" for the rest of it's properties.
How do I determine the difference between this and a real user record
with userid=1?
I can see that the DAO uses the Gateway to get a query, and will throw a
NoMatchingRecord exception if the resultset has 0 records. However this
exception is caught in the abstractRecord.load() method. Maybe there is
an architectural detail I'm missing as to why you would want to hide a
NoMatchingRecord exception from the caller.
Thanks - Simon
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Reactor for ColdFusion Mailing List
[EMAIL PROTECTED]
Archives at: http://www.mail-archive.com/reactor%40doughughes.net/
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --