0 Replies Latest reply on Sep 13, 2006 11:49 AM by Gerd Michalke

    Problem with NamedNativeQuery

    Gerd Michalke Newbie

      Hi,

      JBoss 4.0.4, Linux





      @NamedNativeQuery(name="nbQuestionnairesParEndroitEtDate",
       query="SELECT COUNT(*) AS nb, endroit AS e, MONTH(dateeven) AS m, YEAR(dateeven) AS y from questionnaires group by m,y, e order by e,y,m",
       resultSetMapping="NbQuestionnairesParEndroitEtDateMapping")
      
      @SqlResultSetMapping(name="NbQuestionnairesParEndroitEtDateMapping",
       columns={
       @ColumnResult(name="n"),
       @ColumnResult(name="y"),
       @ColumnResult(name="m"),
       @ColumnResult(name="e")
      })


      This query is called with em.createNamedQuery("nbQuestionnairesParEndroitEtDate").getResultList();

      What I do not know is what bean to write ?

      Would somebody have a working example ? The examples I found only do rely on an existing entity bean, but not on report

      Thanks in advance,
      Gerd