简体   繁体   中英

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?

update to List<BillDetails> obj = query.list(); .if it can not resolve your problem.I want you show us by the all exception and related entities.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM