Closed shenghu closed 6 years ago
Basically when where
is needed, primary ids will be excluded from data
. If where
doesn't include all primary ids, the operation will fail.
When where
is not available, primary ids in data
will be used to form where
predicate.
Description/Steps to reproduce
The update failed w/ error
Link to reproduction sandbox
Expected result
The operation is expected to succeed.
Additional information
ROW.updateAttributes called these codes, SQLConnector.prototype.updateAttributes = function(model, id, data, options, cb) , which is called by DataAccessObject.prototype.updateAttributes.
In DataAccessObject.prototype.updateAttributes, it calls
getIdValue(Model, inst)
doesn't consider the composite primary key.The ideal fix is in juggler to get an object from
getIdValue(Model, inst)
instead of a string value. But before that, a workaround can be inSQLConnector.prototype.updateAttributes
, to put primary keys inwhere
and remove them from data.