Quantcast
Channel: SmartClient Forums
Viewing all articles
Browse latest Browse all 4756

Delete in DMI

$
0
0
I am trying to delete some records in the server-side using a DMI method.

I use this code:
Code:

DSRequest fieldsDeleteRequest = new DSRequest(
                                "table",
                                DataSource.OP_REMOVE, rpcManager);
                fieldsDeleteRequest.setCriteria("f_variante", variantenId);

Where "f_variante" is NOT a primary key.

I get this SQL:
Code:

delete from table where '1' = '1'
So the whole table is being deleted.

If I include fieldsDeleteRequest.setAllowMultiUpdate(true); , then everything works fine:

Code:

DSRequest fieldsDeleteRequest = new DSRequest(
                                "table",
                                DataSource.OP_REMOVE, rpcManager);
fieldsDeleteRequest.setAllowMultiUpdate(true);        fieldsDeleteRequest.setCriteria("f_variante", variantenId);

But when I read the docs of setAllowMultiUpdate(true);:

Code:

provides safeguards for server code
provides safeguards for server code? If this is not set, the COMPLETE table is being deleted! Which should not be.

Using Smartgwt 4.1p power.

Viewing all articles
Browse latest Browse all 4756

Trending Articles