+1 on both. Would it make sense to rename the loadByPk() method reload() ?
If yes, it could make sense to generate the method also if no pk exists
but then throwing an exception.
I also like Thoams' idea of sessing isNew to triue after the object has
been deleted.
Do you mind adding this to the wiki page ?
http://wiki.apache.org/db-torque/NextRelease
Thomas
On Tue, 5 Dec 2006, Greg Monroe wrote:
I've often thought it would be nice for the
generated record object to have a delete()
and loadByPk() methods. It would help
simplify a lot of code.
Of course the loadByPK method would only be
added if there is a primary key. And if there
are multiple primary keys, the method sig. would
be something like:
loadByPk( <colType> key1, <colType> key2...)
throw NoRowsException, TooManyRowsException
and the delete() method would throw an exception
if called on a new record.
Greg Monroe <[EMAIL PROTECTED]> (919)680-5050
C&IS Solutions Team Lead
Duke Corporate Education, Inc.
333 Liggett St.
Durham, NC 27701
Duke CE Privacy Statement
Please be advised that this e-mail and any files transmitted with it are
confidential communication or may otherwise be privileged or confidential and
are intended solely for the individual or entity to whom they are addressed.
If you are not the intended recipient you may not rely on the contents of this
email or any attachments, and we ask that you please not read, copy or
retransmit this communication, but reply to the sender and destroy the email,
its contents, and all copies thereof immediately. Any unauthorized
dissemination, distribution or copying of this communication is strictly
prohibited.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]