标签:
@Transactional public BasAccount findByAccount(String account) { System.out.println(account); Query q = em.createNativeQuery("{call QueryBasAccount(?)}",BasAccount.class); q.setParameter(1, account); List<BasAccount> list = q.getResultList(); BasAccount ba = null; if(list.size()>0){ ba = (BasAccount)q.getResultList().get(0); } return ba; }
语法:{call methodName(?)} Query .setParameter(1, param1);
{call methodName(?,?)} Query .setParameter(1, param1);Query .setParameter(2, param2);
标签:
原文地址:http://www.cnblogs.com/LittleDirewolf/p/5121626.html