I originally posted this to the user list (by accident), so I am
reposting here:

I'm finally getting to the point in my project where I am using Torque. 
Pretty cool since my code base has been essentially broken for months.
My employer really loves me. =)

One assumption I had (mistakenly) made was that calling retrieveByPK
with a key that doesn't exist would return null, not throw an exception:
"Failed to select one and only one row."

I have a few options:

1. Code custom retrieveByXXX methods for each of my Objects, that either
duplicate the code in the PK method, or call it and catch the exception.
(I don't like either, duplicating code is bad, and so is unnecessary
exceptions)

2. Modify places where I use the PK method to catch the exception. (More
unnecessary exceptions)

3. Modify Torque to return null (or so that it is an option in
build.properties).


I think that each of the above options would take a similar amount of
effort to implement.  Can anyone give me reasons for or against
modifying Torque?  The only thing I could think of is if Torque uses the
retrieveByPK methods internally and depends on them never returning
null.

Someone on the user list mentioned using Managers instead.  Is there
somewhere I can read up on Managers?  I thought they were still
experimental.

Thanks.

-james

-- 
[]  James A. Hillyerd <[EMAIL PROTECTED]> - Java Software Engineer
[]  PGP 1024D/D31BC40D F87B 7906 C0DA 32E8 B8F6 DE23 FBF6 4712 D31B C40D


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to