I want to do a server-side DSRequest on a JPA-Datasource, updating multiple records at once.
Here is a simple example: For all invoices with invoiceStatus=-2 we want to set the invoiceStatus to 1.
I use the "allowMultiUpdate" flag to enable updating multiple records. However the following code does only trigger a select on the database. No update is done, despite there are records matching the criteria.
Do I use the "setAllowMultiUpdate" in the correct way?
My datasource looks like this:
I'm using SmartGWT PowerEdition Deployment 2013-06-28.
Here is a simple example: For all invoices with invoiceStatus=-2 we want to set the invoiceStatus to 1.
Code:
com.isomorphic.datasource.DSRequest request = new DSRequest("invoice", "update"); final Map values = new HashMap(); values.put("invoiceStatus", 1); request.setValues(values); request.setCriteria("invoiceStatus", -2); request.setAllowMultiUpdate(true); request.execute();
Do I use the "setAllowMultiUpdate" in the correct way?
My datasource looks like this:
Code:
<DataSource ID="invoice" serverType="jpa" serverConstructor="com.isomorphic.jpa.JPA2DataSource" beanClassName="xyz.Invoice" autoJoinTransactions="true"> <field name="id" type="sequence" readOnly="true" primaryKey="true" required="true" canEdit="false"/> <field name="invoiceStatus" type="integer" hidden="true" canFilter="false"/> ... </DataSource>
Comment