0 Replies Latest reply on Jun 21, 2007 6:05 AM by Aleksandar Stupar

    SqlResultSetMapping

    Aleksandar Stupar Newbie

      Hi,
      I have run into a problem using SqlResultSetMapping.

      I have defined next SqlResultSetMapping:

      @SqlResultSetMapping(name ="Proba",
      entities = {@EntityResult(entityClass=ReportAllTemp.class,
       fields = {
       @FieldResult(name = "locationId",column = "LOCATION_ID"),
       @FieldResult(name = "locationName",column = "LOCATION_NAME"),
       @FieldResult(name = "month",column = "MONTH"),
       @FieldResult(name = "personId",column = "PERSON_ID"),
       @FieldResult(name = "projectId",column = "PROJECT_ID"),
       @FieldResult(name = "projectName",column = "PROJECT_NAME"),
       @FieldResult(name = "taskId",column = "TASK_ID"),
       @FieldResult(name = "taskName",column = "TASK_NAME"),
       @FieldResult(name = "workHours",column = "WORK_HOURS")
       }
      )}
      )


      and I'm using in like this:

      Query q =em.createNativeQuery("select r.* from report_all ","Proba");
       List reports = q.getResultList();
       return reports;


      I thought that it was all ok but Hibernate throws an exception and
      JBOSS says INVALID COLUMN NAME even all columns are defined in report_all.

      Thank you in front.