+1. john mcnally On Fri, 2003-01-24 at 10:24, [EMAIL PROTECTED] wrote: > +1 as well to this idea. I jump through hoops to figure out if an error > returned, or I am missing data. > > ERic > > -----Original Message----- > From: Howard Lin [mailto:[EMAIL PROTECTED]] > Sent: Thursday, January 23, 2003 12:39 PM > To: Turbine Torque Developers List > Subject: RE: [RFC] Changing retrieveByPK > > > It's a good idea. I have the same need. > > Howard Lin > > > -----Original Message----- > > From: Henning P. Schmiedehausen [mailto:[EMAIL PROTECTED]] > > Sent: Thursday, January 23, 2003 7:57 AM > > To: [EMAIL PROTECTED] > > Subject: [RFC] Changing retrieveByPK > > > > > > Hi, > > > > I have the following problem: > > > > In Peer.vm there is the following code: > > > > --- cut --- > > List v = doSelect(criteria, con); > > if (v.size() != 1) > > { > > throw new TorqueException("Failed to select one > > and only one row."); > > } > > else > > { > > return ($table.JavaName)v.get(0); > > } > > --- cut --- > > > > I'd like to distinguish between "no such object found" and > > "an error occured". > > > > How about changing this to > > > > --- cut --- > > List v = doSelect(criteria, con); > > switch (v.size()) > > { > > case 0: > > throw ... some other exception > > > > case 1: > > break; > > > > default: > > throw new TorqueException("Failed to select > > one and only one row."); > > } > > return ($table.JavaName)v.get(0); > > --- cut --- > > > > to make this possible. > > > > Regards > > Henning > > > > -- > > Dipl.-Inf. (Univ.) Henning P. Schmiedehausen -- > > Geschaeftsfuehrer > > INTERMETA - Gesellschaft fuer Mehrwertdienste mbH [EMAIL PROTECTED] > > > > Am Schwabachgrund 22 Fon.: 09131 / 50654-0 [EMAIL PROTECTED] > > D-91054 Buckenhof Fax.: 09131 / 50654-20 > > > > -- > > To unsubscribe, e-mail: > > <mailto:[EMAIL PROTECTED]> > > For additional commands, e-mail: > > <mailto:[EMAIL PROTECTED]> > > > > > > -- > To unsubscribe, e-mail: > <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: > <mailto:[EMAIL PROTECTED]>
-- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
