5 Replies Latest reply on Jul 17, 2003 2:06 PM by diezgo

    finder: 'order' has no effect

    dirk.versavel

      Specifying the tag in a tag in jaws.xml has no effect at all.
      When looking at the generated query, there is no 'ORDER BY' clause added to the query.
      We are currently running JBOSS version 3.2.1.

      What 's wrong??

      Dirk

        • 1. Re: finder: 'order' has no effect
          markfuffzich

          Hi,

          JBoss 3.2.1 is based on EJB 2.0. ORDER BY was introduced with EJB 2.1 which is supported by JBoss 4.0.

          Maybe this is your problem.

          • 2. Re: finder: 'order' has no effect
            dirk.versavel

            Maybe it is, but in this same forum I have found several messages from 2001 and version 2.4 about the fact that the 'order' -tag did not work in certain jboss version for the findAll() method. So I assume it is supported in 3.2.1.

            Can anyone confirm this?

            • 3. Re: finder: 'order' has no effect
              dirk.versavel

              Anyone an idea whether sorting is possible in finders?
              I keep searching the newsgroups but can only find people using it successfully.

              Is it maybe not working on jBOSS 3.2.1 in combination with MySQL?

              Any help is very welcome.

              Dirk

              • 4. Re: finder: 'order' has no effect
                jez

                Hi Dirk

                I'm not sure if this answers your question, but Jboss 3.2 does support order by (although I haven't messed with jaws.xml) - the way I did it was to override my definition in ejb-jar.xml by inserting an identical definition in jbosscmp-jdbc.xml with one change - replace the <ejb-ql> tag with a <jboss-ql> tag.

                In the jbosscmp-jdbc.xml file, you need only replicate the , <ejb-name> and part of the corresponding ejb-jar.xml entry for your EJB.

                I have order by working fine with MySQL on jboss 3.2.0. If only COUNT() worked too...

                • 5. Re: finder: 'order' has no effect
                  diezgo

                  You can modified the jbosscmp-jdbc.xml in tag add definition of ejb-jar.xml the and repleace <ejb-ql> for <jboss-ql> and modified the select sentences and ready to work.

                  Example :

                  ejb-jar.xml

                  ....

                  <query-method>
                  <method-name>findAll</method-name>
                  <method-params/>
                  </query-method>
                  <ejb-ql>
                  <![CDATA[SELECT OBJECT(o) FROM obj o]]>
                  </ejb-ql>



                  jbosscmp-jdbc.xml

                  .
                  .
                  .

                  <query-method>
                  <method-name>findAll</method-name>
                  <method-params/>
                  </query-method>
                  <jboss-ql>
                  <![CDATA[SELECT OBJECT(o) FROM obj o ORDER BY o.fld1]]>
                  </jboss-ql>

                  .
                  .
                  .