Hibernate, createCriteria and Jasper Report
I want to feed a Jasper Report with the join of two tables.
I am using hibernate.
My source code is like:
public List view_report()
List results ;
Session session = HibernateFactory.getSession();
results = HibernateFactory.getSession().createCriteria(Payroll.class).setFetchMode("employee",FetchM ode.JOIN).list();
catch (Exception ex)
Now when i run the Jasper Report, i get the error
java.lang.NoSuchMethodException: Unknown property 'empid'.
What should be done to correct this ?
Its hard to tell -- might be a question you should post on hibernate.org. Having said that, does hibernate successfully persist the Payro II object without running it in JasperReport. The reason I ask is because there appears to be a space in your class named 'Payro ll.class' <--- Which I just copied and pasted from your reference. What class throws the exception? You might want to look at the fatal & error hibernates log stacks.
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL