Hi Amita,

The table must have a primary key defined. We should be throwing an
exception when an update attempt like this takes place. If you want to
open a JIRA and fix this, that would be great. Thanks.

Brent


On 4/4/07, Amita Vadhavkar <[EMAIL PROTECTED]> wrote:
Hi All,

UpdateGenerator.getUpdateCommand()
- Here the logic to form update statement is such that for forming WHERE
CLAUSE,
it first iterates over PKs and then the columns which are undergoing
changes.
In case where, update is occurring on a table row which does not have a PK,
the statement
getting formed is syntactically wrong.

e.g. say table OrderDetails{ORDER_ID, PRODUCT_ID, PRICE} does not have any
PK
and the update is to update ORDER_ID to a new value, then the update
statement
getting formed is
update ORDERDETAILS set ORDER_ID = ? where  and ORDER_ID = ?
which is syntactically wrong.

A simple check on PK list emptiness will rectify this.
Shall I open a JIRA and fix this issue?

Regards,

Amita


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

Reply via email to