3 Replies Latest reply on Dec 23, 2003 5:46 AM by invisiblemage

    jboss-ql ORDER BY in 3.2.2 -- bug?

    James Fairbairn Newbie

      Hello all,

      I've got CMP bean aBean and bean bBean. I've got a query as follows:

      select object(a) from aBean a order by a.bBean.name

      The problem is that we get duplicate aBeans back in the returned collection; the number of duplicates is equal to the number of bBeans, so if there are 6 rows in bBean's table, we get 6 duplicate sets of aBeans back.

      In JBoss 3.0.7 and 3.0.8, we got the expected behaviour, i.e. a collection of distinct aBeans ordered by the name field of their associated bBean.

      Is this a bug, or am I misunderstanding the way jboss-ql works in 3.2.2?

      At a guess, if this is a bug, the SQL query that's being built isn't setting a join condition (WHERE a_bean.b_bean_id=b_bean.b_bean_id), as we are getting what looks like a cartesian product of the contents of the 2 tables. But that's just a guess. Anyone give us a clue?