jpa调⽤mysql函数_Jpa调⽤存储过程及参数public List findAllEntityListBySearch(Long inputInfoId, int flag) throws Exception {
List infoviewList=new ArrayList<>();
EntityManager em = ateEntityManager();
try {
StoredProcedureQuery storedProcedure =em.createStoredProcedureQuery("存储名称");
//下⾯是参数
//参数赋值
storedProcedure.setParameter("InputInfoID",inputInfoId.intValue());
mysql存储过程使用storedProcedure.setParameter("Flags",flag);
//返回list
ResultList();
} catch (Exception ex) {
<("{} method thrown exception++++++","findAllEntityListBySearch", ex);
} finally {
em.close();
}
return infoviewList;
}