使用SSH框架的时候出了一个BUG,希望得到各位学长帮助
public void deleteDetail(BizClaimVoucherDetail detail) {detail = (BizClaimVoucherDetail) voucherDetailDao.findById(BizClaimVoucherDetail.class, detail.getId());
this.voucherDetailDao.delete(detail);
BizClaimVoucher voucher = (BizClaimVoucher) voucherDetailDao.findById(BizClaimVoucher.class, detail.getBizClaimVoucher().getId());
double count =findByCount(detail);
System.out.println(count);
voucher.setTotalAccount(count);
voucherDetailDao.saveOrUpdate(voucher);
}
public double findByCount(final BizClaimVoucherDetail detail){
return Double.parseDouble(this.getHibernateTemplate().execute(new HibernateCallback<String>() {
public String doInHibernate(Session session) throws HibernateException,
SQLException {
Query q = session.createQuery("select sum(account) from BizClaimVoucherDetail where bizClaimVoucher=:bizClaimVoucher");
q.setProperties(detail);
return q.uniqueResult().toString();
}
}));
}
通过调试 程序运行到红色的地方以后直接报错:
Source not found for GeneratedMethodAccessor141.invoke(Object, Object[]) line: not available
--------------------编程问答-------------------- 我以前用过直接new这个接口,但是 一直都是返回的list,,并且泛型也是list ,要不换成list 去取一个试试看。
补充:Java , Web 开发