[jboss-user] [EJB 3.0] - Cannot find a suitable constructor

chrismalan do-not-reply at jboss.com
Sun Feb 25 08:51:02 EST 2007

I have a custom util class called LessonView.  It looks like this:

public class LessonView{
  | private String subject;
  | private int year, count;
  | public LessonView(){}
  | public LessonView(String subject, int year, int count){
  |   sets the variables via setters
  | }
  | public getters and setters
  | }

Then I have a query:
"select new LessonView(l.subject, l.year, count(*)) from Lesson l group by l.lesson, l.year order by l.lesson, l.year";

This throws exceptions telling me there is no suitable constructor.  When the count(*) is removed everything works fine.  I have used custom classes before with sum(whatever.k) and it worked fine.  I have also tried count(l.id), same results.

Any idea how to fix this?  The database is MySQL.  


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4021964#4021964

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4021964

More information about the jboss-user mailing list