Using smartgwt smartgwtpower-5.0p.
In our datasouce, among other DatasourceField definitions, the following 3 are of following type.
<field name="status" type="enum" title="Status" width="8%" defaultValue="active, acknowledged" multiple="true" >
<field name="severity" type="enum" title="severity" width="5%" initSortColumn="true" multiple="true" >
<field name="createtime" type="datetime" title="Time" width="12%" initSortColumn="true" customCriteriaExpression="(createtime #if ($criteriaOperator == 'greaterOrEqual') >= #else <= #end UNIX_TIMESTAMP($criteriaValue))" />
The column 'createtime' is stored as a numeric value in the database but being converted to datetime on the display.
Now, here is the problem. When we do not specify any start/end time values in the filter criteria, the where clause is getting generated correctly.
WHERE (((system_event_table.status LIKE '%active%' AND system_event_table.status IS NOT NULL) OR (system_event_table.status LIKE '%acknowledged%' AND system_event_table.status IS NOT NULL)) AND ((system_event_table.severity='crit') OR (system_event_table.severity='maj') OR (system_event_table.severity='min') OR (system_event_table.severity='warn')))
However when we specify in the GUI filter editor the time interval for createtime, the where clause looks as shown below. It appears that createtime is getting represented correctly. However, the values of enum types are not handled correctly (for both severity and status fields)
WHERE ((('0'='1' OR '0'='1' OR '0'='1' OR '0'='1') OR ('0'='1' OR '0'='1' OR '0'='1' OR '0'='1') OR ('0'='1' OR '0'='1' OR '0'='1' OR '0'='1') OR ('0'='1' OR '0'='1' OR '0'='1' OR '0'='1')) AND (createtime >= UNIX_TIMESTAMP('2015-02-18 00:00:00')) AND (((system_event_table.status = 'active' AND system_event_table.status IS NOT NULL) OR (system_event_table.status LIKE 'active, %' AND system_event_table.status IS NOT NULL) OR (system_event_table.status LIKE '%, active, %' AND system_event_table.status IS NOT NULL) OR (system_event_table.status LIKE '%, active' AND system_event_table.status IS NOT NULL)) OR ((system_event_table.status = 'acknowledged' AND system_event_table.status IS NOT NULL) OR (system_event_table.status LIKE 'acknowledged, %' AND system_event_table.status IS NOT NULL) OR (system_event_table.status LIKE '%, acknowledged, %' AND system_event_table.status IS NOT NULL) OR (system_event_table.status LIKE '%, acknowledged' AND system_event_table.status IS NOT NULL))))
Appreciate your help...
Thanks
In our datasouce, among other DatasourceField definitions, the following 3 are of following type.
<field name="status" type="enum" title="Status" width="8%" defaultValue="active, acknowledged" multiple="true" >
<field name="severity" type="enum" title="severity" width="5%" initSortColumn="true" multiple="true" >
<field name="createtime" type="datetime" title="Time" width="12%" initSortColumn="true" customCriteriaExpression="(createtime #if ($criteriaOperator == 'greaterOrEqual') >= #else <= #end UNIX_TIMESTAMP($criteriaValue))" />
The column 'createtime' is stored as a numeric value in the database but being converted to datetime on the display.
Now, here is the problem. When we do not specify any start/end time values in the filter criteria, the where clause is getting generated correctly.
WHERE (((system_event_table.status LIKE '%active%' AND system_event_table.status IS NOT NULL) OR (system_event_table.status LIKE '%acknowledged%' AND system_event_table.status IS NOT NULL)) AND ((system_event_table.severity='crit') OR (system_event_table.severity='maj') OR (system_event_table.severity='min') OR (system_event_table.severity='warn')))
However when we specify in the GUI filter editor the time interval for createtime, the where clause looks as shown below. It appears that createtime is getting represented correctly. However, the values of enum types are not handled correctly (for both severity and status fields)
WHERE ((('0'='1' OR '0'='1' OR '0'='1' OR '0'='1') OR ('0'='1' OR '0'='1' OR '0'='1' OR '0'='1') OR ('0'='1' OR '0'='1' OR '0'='1' OR '0'='1') OR ('0'='1' OR '0'='1' OR '0'='1' OR '0'='1')) AND (createtime >= UNIX_TIMESTAMP('2015-02-18 00:00:00')) AND (((system_event_table.status = 'active' AND system_event_table.status IS NOT NULL) OR (system_event_table.status LIKE 'active, %' AND system_event_table.status IS NOT NULL) OR (system_event_table.status LIKE '%, active, %' AND system_event_table.status IS NOT NULL) OR (system_event_table.status LIKE '%, active' AND system_event_table.status IS NOT NULL)) OR ((system_event_table.status = 'acknowledged' AND system_event_table.status IS NOT NULL) OR (system_event_table.status LIKE 'acknowledged, %' AND system_event_table.status IS NOT NULL) OR (system_event_table.status LIKE '%, acknowledged, %' AND system_event_table.status IS NOT NULL) OR (system_event_table.status LIKE '%, acknowledged' AND system_event_table.status IS NOT NULL))))
Appreciate your help...
Thanks
Comment