Uploaded image for project: 'OpenJPA'
  1. OpenJPA
  2. OPENJPA-81

Bad error message when trying to query a Collection relation using dot notation

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Not A Problem
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: diagnostics, query
    • Labels:
      None
    • Environment:
      openJPA 0.9.7
      MySQL 5.0.15

      Description

      the query over the 1:n relationship 'katergorien'

      em.createQuery("select distinct k from KategorieGruppe k " +
      "where k.kategorien.bezeichnung like ?1 " +
      "order by k.bezeichnung asc");

      uses a wrong alias t2 in the generated SQL:

      SELECT DISTINCT t0.id, t0.bezeichnung FROM ekv2kategoriegruppe t0 INNER JOIN ekv2kategorie t1 ON t0.id = t1.idGruppe WHERE (t2.bezeichnung LIKE ? ESCAPE '
      ') ORDER BY t0.bezeichnung ASC [params=(String) F%]

      Unknown column 't2.bezeichnung' in 'where clause'

        Attachments

          Activity

            People

            • Assignee:
              jtnowosatka Jacob Nowosatka
              Reporter:
              brj Jakob Braeuchi
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: