1 Reply Latest reply on Apr 11, 2005 8:52 AM by John M. Nordgaard

    ejbSelect and ORDER BY

    John M. Nordgaard Newbie

      My question is very simple, I have this ejbSelect and EJB-QL:

      java.util.Set ejbSelectStuff(Long objectTypePK, int value)

      SELECT DISTINCT Object(rt)
      FROM ObjectType ot, IN(ot.relatedTypes) rt
      WHERE ot.objectTypePK= ?1
      AND ?2 BETWEEN rt.minimum AND rt.maximum
      ORDER BY rt.major ASC, rt.minor ASC

      (the names have been changed to protect the innocent ;)

      Now, the above EJB-QL compiles and runs without complaints, and it returns the correct set of objects. However, the resulting set is in completely random order, not sorted by either rt.major or rt.minor.

      I'm using versions 3.2.7 and 4.0.1sp1, same problem on both.

      Any idea what's wrong?