Hey guys, I am trying to execute the following query and get a
Code:
net.sf.hibernate.QueryException: in expected: select [select e.cert ....
Now the query is pretty beefed up, but we want to see if you can run this kind of subquery through Hibernate.
Code:
select e.certSerNbr, e.psdVendId, e.psdModId, e.psdSerNbr, e.dupErrCode, e.postgType, e.mailType, e.POSTAGE, e.COUNT, first.orgnScanFclt, e.MINTIME, recent.orgnScanFclt, e.MAXTIME
from
(select es.certSerNbr, es.psdVendId, es.psdModId, es.psdSerNbr, es.postgType, es.mailType, count(es.mailpieceId) as COUNT, es.postVal as POSTAGE, min(es.orgnScanTime) as MINTIME, max(es.orgnScanTime) as MAXTIME from ExceptionSum es where es.dupErrCode = 'D' and es.dupErrCode not like '%O%' group by es.certSerNbr, es.psdVendId, es.psdModId, es.psdSerNbr, es.postgType, es.postgVal, es.mailType) e,
ExceptionSum first, ExceptionSum recent
where e.orgnScanTime between :dateFrom and :dateTo and e.dupErrCode = 'D' and e.dupErrCode not like '%O%' and first.certSerNbr = e.certSerNbr and first.psdVendId = e.psdVendId and first.psdModId = e.psdModId and first.psdSerId = e.psdSerId and e.MINTIME = first.orgnScanTime and recent.certSerNbr = e.certSerNbr and recent.psdVendId = e.psdVendId and recent.psdModId = e.psdModId and recent.psdSerId = e.psdSerId and e.MAXTIME = recent.orgnScanTime
can hibernate handle something like this? we have been looking through the query over and over again for possible syntax errors, but we don't know why we are getting this exception.
thanks, erica