When I call my stored procedure with 3 select queries in mysql, then it returns 3 result sets, but when I call it in spring it only returns a single result set.
Below is the code calling the stored procedure in Spring:
@ResponseBody
@RequestMapping(value="/", method=RequestMethod.GET, produces="application/json", headers="Accept=application/json")
public String listProducts() throws ParseException {
int id=1;
int days=20;
Query query = session.createNativeQuery("{call getWalkInInfo(?,?)}", Product.class);
query.setParameter(1,id);
query.setParameter(2,days);
Gson gson=new Gson();
String jsonArray=gson.toJson(query.getResultList());
System.out.println(jsonArray);
return jsonArray;
}