absolutely there is a solution two ways you can achieve this, as mentioned by Debu Panda you can create a comma separated
String and dynamically add it to a query
like
String statesCode= "'A', 'E'";
select t from Thing t where t.status in (statesCode)")
.getResultList();
OR
List<String> inList = new ArrayList<String>();
inList.add("'A'");inList.add("'E'");
select t from Thing t where t.status in (:statesCode)")
.getResultList();
query.setParameter("statesCode", inList );
Hope this helps.