I have this query in spring boot, in one of the dao class.
QUERY
String sql = select * from language where screen = ? and lang = ? and screenid in (?)
REQUEST OBJECT
{
"language" : {
"screen" : "Index",
"lang": "english",
"screenid" : ["250","10","44","11"]
}
}
I fetch each of the values, that came from JSON request and store it into bean.
QUESTION
The screenid has array of string values, How can I pass that in query ?
I tried,
String ids = LangObj.get("screenid").toString();
// this gives the value as ["250","10","44","11"]
when passed this value directly to query it forms as select * from language where screen = 'Index' and lang = 'english' and screenid in (["250","10","44","11"])
and thus not giving any output, I am looking for a query that to be formed like the below,
select * from language where screen = 'Index' and lang = 'english' and screenid in ('250','10','44','11')
Any suggestions ?