db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Vandahl ...@apache.org>
Subject Re: Can't save object that has no fields except primary key
Date Sun, 27 Aug 2006 09:49:29 GMT
Noel Murphy wrote:
> I will admit that I'm fairly new to Torque, however my other objects 
> seems to save alright. In case it matters, I'm using the idBroker way of 
> generating primary key values.

That matters indeed. If you declare the column as primaryKey and the 
idMethod of the table is "idBroker" you state to Torque that it should 
deal with the value of that column. So there is nothing else to save - 
which is what the exception says. I cannot believe that this is actually 
what you want because you won't be able to find your value again nor 
have you any method to access related records.

If you really want to save values of keys in the table described, you 
need to define the table as idMethod="none" or remove the column 
declaration as primary key.

As a side note: Defining a column as primary key means that the values 
in the column must be unique, which is normally assured by an unique 
index. Based on this rule I do not understand what your table should do 
at all. I suggest to check you database schema again.

Bye, Thomas.

To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org

View raw message