1 Reply Latest reply on Oct 28, 2003 6:14 PM by eric g

    Sort collections of CMR

    vivachu Newbie

      Is there a way to append an ORDER BY clause to the SQL statement of a CMR collection?

        • 1. Re: Sort collections of CMR
          eric g Newbie

          hello,

          May be you could try the most common jboss <jboss-ql> query override using the jbosscmp-jdbc.xml wherby you declared the query enclosed using the <jboss-ql>xml tag like the example from JBOSS CMP 3.X


          <query-method>
          <method-name>findBadDudes_jbossql</method-name>
          <method-params><method-param>int</method-param></method-params>
          </query-method>
          <jboss-ql><![CDATA[
          SELECT OBJECT(g)
          FROM gangster g
          WHERE g.badness > ?1
          ORDER BY g.badness DESC
          ]]></jboss-ql>




          Thanks