> There is one genuine bug I want to tackle soon.  If you have a table
with
> no primary keys, and don't set idMethod="none", you get a null pointer
> exception when you do a .save on it.  Took me a while to figure out
what
> was going on.

When you go to tackle this, I think a macro/variable/method should be
added to handle the logic of the autoincrement stuff instead of having
it spread throughout the templates. I'm not well versed enough in the
templates to know what the best approach is.

My current guess would be adding/overriding something like
isAutoIncrement/getIdMethod in
org.apache.torque.engine.database.model.Column. Assuming the column
object has a reference to its parent table/database so it can check its
inherited id method. This would centralize the semantic confusion that
Bill mentioned.

Actually, just to make sure we're all on the same page, the database and
table defaultIdMethod attributes don't have any affect on which columns
have autoincrement. A column must explicitly declare autoIncrement=true
for it to have autoincrement functionality.

And once this is done, the method that is used for autoincrement is
based on the column's idmethod, table's defaultIdMethod, or database's
defaultIdMethod, whichever is ...closest, for lack of a better word, to
the column.

At least that's my take on it...sound right?

- Stephen


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

Reply via email to