Currently the query takes in a single reportID to return the results. Now if I want to pass multiple reportIDs and return the o/p in just 1 call to the DB, how do I do that?
String queryText = "from com.abc.domain.bcd.Report report where report.reportID in :reportId";
Query query = SessionFactory.getCurrentSession().createQuery(queryText.toString());
query.setParameter("reportID", reportId);
query.list();
I tried passing as an arrayList but no luck. Got the error below
List<String> reportID= new ArrayList<String>();
reportID.add("aaa");
reportID.add("bbb");
java.util.ArrayList incompatible with java.lang.String
try this one
query.setParameterList("reportID", new Object[]{"aaa","bbb"});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With