You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-user@db.apache.org by gideon juve <ju...@usc.edu> on 2003/05/16 23:26:59 UTC

Autoincrement of primary key in MySQL

Hi all,

I just started using Torque the other day and I am having a little bit
of a problem. I can't figure out how to get the autoincrement fields of
my table object classes to synchronize with the database. For example, I
have a table called 'fault' that has an autoincremented primary key
called FaultID. I can do this:

fault f = new fault();
f.save();

and it will put the default data in the database correctly, but when I
follow that with:

f.getFaultID();

I get the default value for FaultID instead of the value that was
assigned by MySQL through autoincrement. I think that the problem has
something to do with how I have idMethod set in my schema, but I'm not sure.

Any help would be greatly appreciated.

Thanks,
Gid