Jump to content
Changes to the Jaspersoft community edition download ×

hibernate count(*), sum() bug

Recommended Posts

By: David Duchaine - dduchaine

hibernate count(*), sum() bug

2006-03-21 12:50

The count() or sum() aggregations are not working within an Hibernate query.


Example query:

select sum(service.qty) as quantity from com.company.Service as service


Exception we get:


Error filling print...

Hibernate session opened Hibernate session closed java.lang.ClassCastException: java.lang.Integer at net.sf.jasperreports.engine.data.JRHibernateAbstractDataSource$IndexFieldReader.getFieldValue(JRHibernateAbstractDataSource.java:276) at net.sf.jasperreports.engine.data.JRHibernateAbstractDataSource.getFieldValue(JRHibernateAbstractDataSource.java:236) at net.sf.jasperreports.engine.fill.JRFillDataset.next(JRFillDataset.java:727) at net.sf.jasperreports.engine.fill.JRBaseFiller.next(JRBaseFiller.java:932) at net.sf.jasperreports.engine.fill.JRVerticalFiller.fillReport(JRVerticalFiller.java:126) at net.sf.jasperreports.engine.fill.JRBaseFiller.fill(JRBaseFiller.java:730) at net.sf.jasperreports.engine.fill.JRFiller.fillReport(JRFiller.java:123) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:420) at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:256) at it.businesslogic.ireport.IReportCompiler.run(IReportCompiler.java:701) at java.lang.Thread.run(Unknown Source)

Print not filled. Try to use an EmptyDataSource...!



Any idea?




By: David Duchaine - dduchaine

RE: hibernate count(*), sum() bug

2006-03-21 13:01

Found this workaround in CVS if you don't want to patch code:


Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...