I need to execute a complicated query as below --
select a.covno, a.covdesc, b.limitsno from Coverage a, Policycoverage b where policyno = :policyno and customerno = :customerno and a.covno = b.coverage.covno union select covno, covdesc, null from Coverage where covno not in (select c.covno from Coverage c, Policycoverage d where c.covno = d.coverage.covno and d.policyinfo.policyno = :policyno and d.customerno = :customerno)
this is the pseudo code --
Query qry = session.createSQLQuery(qryString); //qryString is the above sql
qry.setParameter("policyno", new Integer(1));
qry.setParameter("customerno", new Integer(1));
List list = qry.list();
This code throws an exception "addEntity() or addScalar() must be called"
I need to get the results back in List of HashMap fashion. How do I fix the query/code to 1)avoid the error and 2)get List of HashMap back which represents the ResultSet
Please help!!
- Nilesh
|