Hi,
When I was trying to execute the below HQL Query it is giving
Exceptionjava.lang.ClassCastException: java.lang.Long Exception.
String query =
"SELECT dg.copyCount,dc.documentpath,dc.marginLeft, dc.marginRight, " +
" dc.marginTop, dc.marginBottom,dc.linesPerPage,dc.pageOrientation,"+
"dtc.printerTypeId FROM LtCaDmDocument dc, DocumentSet dg,StDocumentSetMapping dgh ,"+
"LtCaDmDocumentType dtc" +
" WHERE dgh.id.stCode=? AND dc.ltCaDmDocumentType.docTypeId=dtc.docTypeId AND "+
"dg.id.docId=? AND dgh.id.docSetCode=dg.documentSetCode.docSetCode AND dg.id.docId=dc.docId AND dc.ltCaDmDocumentType.docTypeId=? " +
" AND to_date(?,'MM/DD/YYYY') >= trunc(dgh.id.startDate) " +
" AND to_date(?,'MM/DD/YYYY') <= decode(dgh.endDate,NULL, to_date(?,'MM/DD/YYYY')," +
" trunc(dgh.endDate)) " +
" AND to_date(?,'MM/DD/YYYY') >= trunc(dg.id.startDate) " +
" AND to_date(?,'MM/DD/YYYY') <= decode(dg.endDate,NULL, to_date(?,'MM/DD/YYYY')," +
" trunc(dg.endDate)) ";
//alist = dam.select(query, data, dataType);
//org.hibernate.Session hbSession=HibernateUtil.currentSession();
alist=HibernateBo.convertToArryList(hbSession.createQuery(query).
setBigDecimal(0,new BigDecimal(locNbr)).
setString(1,docCd).
setString(2,docTypeCd).
setString(3,date).
setString(4,date).
setString(5,date).
setString(6,date).
setString(7,date).
setString(8,date).
list());
please help me out. I am very thankful for the suggestions
with regards
Pravo
|