db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gabriel Bauman <g...@bravenet.com>
Subject Re: The 'native' id method, primary keys, and auto_increment
Date Tue, 01 Jul 2003 05:59:38 GMT
Just to follow up to my own message...

I removed the code I highlighted in my last email, and regenerated my 
SQL, resulting in a primary INTEGER key with no auto_increment field, as 
I wanted.

Unfortunately, now when I set the primary key column to a value and call 
save() on the object, it becomes a 0 in the database.

With Id being INTEGER(4), primary key, not null, auto_increment...

someObject.setId(12345);
someObject.save();

... someObject.getId() now returns 0. the column 'id' is also 0 in the 
database.

Perhaps someone could shed some light on why this is the case? I am 
using the complex object model.

Gabe




Mime
View raw message