-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Exceptionjava.lang.ClassCastException: java.lang.Long
PostPosted: Tue Jan 03, 2006 4:43 am 
Newbie

Joined: Mon Jan 02, 2006 8:15 am
Posts: 5
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


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jan 03, 2006 5:00 am 
Newbie

Joined: Tue Jan 18, 2005 7:08 am
Posts: 10
Maybe you should try to debug this piece of code and search the place, where the ClassCast-Exception occurs.
You are trying to convert some data into Long which cannot be converted (maybe a String?)

Regards, Peter


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.