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

Bug/Unexpected TextMatchStyle-behaviour in serverside DSRequest.addToCriteria()

$
0
0
Hi Isomorphic,

please note the following unexpected behaviour:

I have a client-side ComboBoxItem with
Code:

setTextMatchStyle(TextMatchStyle.SUBSTRING);
setValueField("ID"); //integer-field
setDisplayField("NAME"); // text-field

The generated SQL (so far as expected) is:
Code:

t_reseller.name LIKE '%mysearchstring%' ESCAPE '\' AND t_reseller.name IS NOT NULL
In my subclassed SQLDataSource I do:
Code:

@Override
public DSResponse executeFetch(DSRequest req) throws Exception {
        dsRequest.addToCriteria("TENANT_ID", DefaultOperators.Equals, 0); // TENANT_ID is an integer-field
        return super.executeFetch(req);
}

The generated SQL looks like
Code:

AND (t_reseller.tenant_id LIKE '%0%' ESCAPE '\' AND t_reseller.tenant_id IS NOT NULL)
where I would expect a TENANT_ID=0 condition.
This is also true for an even more explicit
Code:

dsRequest.addToCriteria(new AdvancedCriteria(new SimpleCriterion("TENANT_ID", DefaultOperators.Equals, 0)));
The generated SQL for TENANT_ID changes when I change the TextMatchStyle of the ComboBoxItem. I think that this might be a bug (SNAPSHOT_v9.1d_2014-01-22/EVAL Deployment).

Best regards,
Blama

Viewing all articles
Browse latest Browse all 4756

Trending Articles