1 Reply Latest reply on May 8, 2003 4:03 AM by Jon Barnett

    EJB QL ORDER BY problem

    Dries De Moor Newbie

      Hello,

      I'm using jboss 3.0.4.
      In one of my entity beans I defined a finder method
      with an order by clause.

      The xDoclet tags look like this:

      * @ejb:finder signature="Collection findByMachine(java.lang.String machine)"
      * query="SELECT OBJECT(m) FROM machinewerkpost m WHERE m.machine = ?1"
      *
      * @jboss:query signature="Collection findByMachine(java.lang.String machine)"
      * query="SELECT OBJECT(m) FROM machinewerkpost m WHERE m.machine = ?1 ORDER BY m.volgNr"

      I deploy on a Hypersonic DB and everything works fine. I deploy on Informix DB and I get the following error: Find Failed: java.sql.SQLException: ORDER BY column (volgNr) must be in SELECT list.

      Can somebody explain this? Why is it working on Hypersonic DB and not on Informix DB?
      How can I solve it?

      Thanks a lot,


      Dries

        • 1. Re: EJB QL ORDER BY problem
          Jon Barnett Master

          This means that Informix does not like having an order by clause governed by column that does not exist in the result set (i.e. is not one of the output columns). This is compliant with the SQL92 spec. I've heard rumours that Informix 9.40 addresses this - although it means breaking compliance with SQL92.