I don't believe you can use that method to operate on the fields that you want to change, you can only use it to update to a predefined value i.e. a map containing [salary, 10000] for fieldsToSet

If you wanted to multiply each salary by 10 (how generous of you :-) you would probably be best to retrieve the list of records you want to change, iterate of over them changing each record one by one and then use delegator.storeAll(luckyEmployees);

Regards
Scott

On 21/05/2009, at 6:47 PM, Vikas Jadhav wrote:

Hi,

I am using GenericDelegator to to retrieve or store data from the tables.

But I am facing some problems to update some records using delegators.

e.g. I have a table as below.
EMP (empId primary key, name, age, salary, dept foreign key)

Here I want to update the salary of all the employees who belongs to
specific department.
e.g.
UPDATE EMP set salary=salary * 10 where dept='QA';

So, how to put this in ofbiz delegator.
How to set fields to update in query.

especially.. how to put salary=salary*10 in fieldsToUpdate map?

Thanks,
Vikas

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to