Hi Isomorphic,
I have a per-operationType DMI (acting on update), that does issue following additional request:
The OperationBinding is as follows:
The generated SQL is:
See how the WHERE-clause of the generated SQL is 'N' and not 'J' as expected from the ds.xml criteria.
Also setting the criteria in the code does not solve this. Once set, setValues overwrites them. For me, this seems to be a bug.
Best regards,
Blama
I have a per-operationType DMI (acting on update), that does issue following additional request:
Code:
DSRequest secondUpdateRequest = new DSRequest(dsRequest.getDataSource().getID(), "update"); secondUpdateRequest.setOperationId("updateHauptadresse"); secondUpdateRequest.setRPCManager(dsRequest.getRPCManager()); secondUpdateRequest.setValues(new HashMap<String, String>() { { put("HAUPTADRESSE", "N"); } }); DSResponse secondUpdateResponse = secondUpdateRequest.execute();
Code:
<operationBinding operationType="update" operationId="updateHauptadresse" allowMultiUpdate="true"> <criteria fieldName="HAUPTADRESSE" value="J" /> <values fieldName="MODIFIED_BY" value="1" /> <values fieldName="MODIFIED_AT" value="$currentDate" /> </operationBinding>
Code:
=== 2012-04-18 12:14:30,378 [l0-6] DEBUG AppBase - [builtinApplication.updateHauptadresse] No userTypes defined, allowing anyone access to all operations for this application === 2012-04-18 12:14:30,379 [l0-6] DEBUG AppBase - [builtinApplication.updateHauptadresse] No public zero-argument method named '_updateHauptadresse' found, performing generic datasource operation === 2012-04-18 12:14:30,384 [l0-6] INFO SQLDataSource - [builtinApplication.updateHauptadresse] Performing update operation with criteria: {HAUPTADRESSE:"J"} values: {MODIFIED_AT:new Date(1334744070372),MODIFIED_BY:1,HAUPTADRESSE:false} === 2012-04-18 12:14:30,389 [l0-6] INFO SQLDriver - [builtinApplication.updateHauptadresse] Executing SQL update on 'Oracle': UPDATE T_ANSCHRIFT SET HAUPTADRESSE='N', MODIFIED_AT=TO_DATE('2012-04-18 12:14:30','YYYY-MM-DD HH24:MI:SS'), MODIFIED_BY=1 WHERE (T_ANSCHRIFT.HAUPTADRESSE='N') === 2012-04-18 12:14:30,392 [l0-6] DEBUG SQLDataSource - [builtinApplication.updateHauptadresse] update operation affected 2 rows
Also setting the criteria in the code does not solve this. Once set, setValues overwrites them. For me, this seems to be a bug.
Best regards,
Blama
Comment