[英]Exception org.hibernate.exception.GenericJDBCException: could not extract ResultSet while feching data using hql
I am trying to get bill details using following query 我正在尝试使用以下查询获取账单详细信息
String hql = "from BillDetails as bd "
+ "left join fetch bd.billPaidDetails as bpd"
+ "where bd.client.id=:cid "
+ "and sum(bpd.amount)<bd.total "
+ "order by bd.addDate";
Query query = session.createQuery(hql);
query.setParameter("cid", cid);
obj = query.list();
Here one bill have many billPaidDetails
I want to fetch only those bills that are not fully paid for that I am using sum(bpd.amount)<bd.total
in where condition but this is showing Exception org.hibernate.exception.GenericJDBCException: could not extract ResultSet
How to resolve above exception? 在这里,一个账单有很多billPaidDetails
我只想获取那些在条件下使用sum(bpd.amount)<bd.total
未完全付清的账单,但显示Exception org.hibernate.exception.GenericJDBCException: could not extract ResultSet
如何解决以上异常?
update to List<BillDetails> obj = query.list();
更新到List<BillDetails> obj = query.list();
.if it can not resolve your problem.I want you show us by the all exception and related entities. .if无法解决您的问题。我希望您向我们展示所有异常和相关实体。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.