This is a migrated thread and some comments may be shown as answers.

convert JSON filter string to sql string how?

1 Answer 204 Views
Grid
This is a migrated thread and some comments may be shown as answers.
alooosh
Top achievements
Rank 1
alooosh asked on 30 Dec 2015, 06:53 AM

Hi experts, I am getting my JSon represnationof my filter in kendo grid. Now what I am looking for I need to apply that filtering in the server so I can get coorect data and return it to the grid . The problem is the filter string is too much complicated and I could represent it to sql statement. how I can do that please help me?

my JSON filter text as below:

{"logic":"and","filters":[{"logic":"or","filters":[{"field":"name","operator":"contains","value":"ji"},{"field":"name","operator":"contains","value":"james"}]},{"logic":"or","filters":[{"field":"price","operator":"contains","value":"ali"},{"field":"price","operator":"eq","value":"aaa"}]},{"logic":"and","filters":[{"field":"labor","operator":"eq","value":"staff"},{"field":"labor","operator":"endswith","value":"ss"}

I am using jsp and java as my programming language , so is there any function or method could convert the filter expression to sql or not.

 

thanks in advance

1 Answer, 1 is accepted

Sort by
0
Boyan Dimitrov
Telerik team
answered on 04 Jan 2016, 09:11 AM
Hello,

Indeed in some cases the filtering expression could be a bit complicated (especially when there are nested filtering expressions). There is no built-in methods/functions that converts JSON to sql query. 

Since this is not related to the Kendo UI framework itself I would suggest to find a libraries or Java frameworks, which will parse JSON to sql queries. 

Regards,
Boyan Dimitrov
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Tags
Grid
Asked by
alooosh
Top achievements
Rank 1
Answers by
Boyan Dimitrov
Telerik team
Share this question
or