title: org.hibernate.HibernateException: Could not instantiate resultclass
body: <p>Full stack trace:</p>
  
  <pre><code>org.hibernate.HibernateException: Could not instantiate resultclass: com.firstbankpr.lmu.data.dto.EmployeeScore
  at org.hibernate.transform.AliasToBeanResultTransformer.transformTuple(AliasToBeanResultTransformer.java:99)
  at org.hibernate.hql.HolderInstantiator.instantiate(HolderInstantiator.java:96)
  at org.hibernate.loader.custom.CustomLoader.getResultList(CustomLoader.java:361)
  at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2276)
  at org.hibernate.loader.Loader.list(Loader.java:2271)
  at org.hibernate.loader.custom.CustomLoader.list(CustomLoader.java:316)
  at org.hibernate.impl.SessionImpl.listCustomQuery(SessionImpl.java:1842)
  at org.hibernate.impl.AbstractSessionImpl.list(AbstractSessionImpl.java:165)
  at org.hibernate.impl.SQLQueryImpl.list(SQLQueryImpl.java:157)
  at com.nimchip.lmu.data.dao.hibernate.WinnerHibernateDAO.findEmployeeTotals(WinnerHibernateDAO.java:155)
  at com.nimchip.lmu.data.dao.WinnerDAOTest.testEmpScore(WinnerDAOTest.java:159)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
  at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
  at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
  at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
  at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
  at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74)
  at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:83)
  at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72)
  at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:231)
  at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
  at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
  at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
  at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
  at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
  at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
  at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
  at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71)
  at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
  at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:174)
  at org.junit.runner.JUnitCore.run(JUnitCore.java:157)
  at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:71)
  at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:199)
  at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:62)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
  at com.intellij.rt.execution.application.AppMain.main(AppMain.java:120)
  </code></pre>
  
  <p>Line 11 points to the last line in this query:</p>
  
  <pre><code>        Query query = currentSession().createSQLQuery(
              "select n.EMP_ID as id, SUM(DISTINCT(nom.TOTAL_POINT)) as score from" +
                      " NOMINEE n join NOMINATION nom on nom.NOM_ID = n.NOM_ID" +
                      " join EMPLOYEE e on n.EMP_ID = e.EMP_ID" +
                      " join COMPANY c on c.COMPANY_CODE = e.COMPANY_CODE" +
                      " join REGION r on r.REGION_ID = c.REGION_ID" +
                      " where nom.PERIOD_ID = :periodId" +
                      " AND nom.STATUS_ID = 2" +
                      " AND e.ISACTIVE = 1" +
                      " AND nom.CATEGORY_CODE != 'H'" +
                      " AND r.REGION_ID = :regionId" +
                      " group by n.EMP_ID")
              .addScalar("id")
              .addScalar("score")
              .setParameter("regionId", regionId)
              .setParameter("periodId", periodId)
              .setResultTransformer(Transformers.aliasToBean(EmployeeScore.class));
  </code></pre>
  
  <p>Here's the EmployeeScore.class:</p>
  
  <pre><code>public class EmployeeScore {
  
      private int id;
      private int score;
  
      EmployeeScore(){}
  
      public EmployeeScore(int id, int score) {
          this.id = id;
          this.score = score;
      }
  
      public int getId() {
          return id;
      }
  
      public void setId(int id) {
          this.id = id;
      }
  
      public int getScore() {
          return score;
      }
  
      public void setScore(int score) {
          this.score = score;
      }
  
      @Override
      public boolean equals(Object o) {
          if (this == o) return true;
          if (o == null || getClass() != o.getClass()) return false;
  
          EmployeeScore that = (EmployeeScore) o;
  
          if (id != that.id) return false;
          if (score != that.score) return false;
  
          return true;
      }
  
      @Override
      public int hashCode() {
          int result = id;
          result = 31 * result + score;
          return result;
      }
  }
  </code></pre>
  
  <p>Constructors are in, why isn't it working? Note: I'm also using Spring and this is a DTO bean.</p>
  
  <p>What am I missing here?</p>