Labels queries do not run on DB2.

XMLWordPrintable

      The labels sql queries do not run on DB2.

      Under the default DB2 hibernate dialect, the following query:
      select

      {l.*}

      , count(lc2.LABELID) as LABELCOUNT from LABEL l, LABEL_CONTENT lc1, LABEL_CONTENT lc2 where lc1.LABELID = :labelID and lc1.CONTENTID = lc2.CONTENTID and lc2.LABELID != :labelID and lc2.LABELID = l.LABELID group by lc2.LABELID, l.LABELID, l.LABELTYPE, l.NAME, l.OWNER, l.CREATIONDATE, l.LASTMODDATE order by LABELCOUNT

      is converted into

      select * from ( select rownumber() over(order by LABELCOUNT) as row_, l.LABELID as LABELID0_, l.LABELTYPE as LABELTYPE0_, l.NAME as NAME0_, l.OWNER as OWNER0_, l.CREATIONDATE as CREATION5_0_, l.LASTMODDATE as LASTMODD6_0_, count(lc2.LABELID) as LABELCOUNT from LABEL l, LABEL_CONTENT lc1, LABEL_CONTENT lc2 where lc1.LABELID = 15 and lc1.CONTENTID = lc2.CONTENTID and lc2.LABELID != 15 and lc2.LABELID = l.LABELID group by lc2.LABELID, l.LABELID, l.LABELTYPE, l.NAME, l.OWNER, l.CREATIONDATE, l.LASTMODDATE order by LABELCOUNT ) as temp_ where row_ <= 10

      This query does not execute against the DB2 database.

      Side note:
      --------------
      The query works correctly using the DB2390Dialect.

      Further investigation required.

              Assignee:
              Unassigned
              Reporter:
              Daniel Ostermeier
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: