Uploaded image for project: 'OpenJPA'
  1. OpenJPA
  2. OPENJPA-51 bad sql pushdown, sub select is missing from clause
  3. OPENJPA-658

select count(o) in subquery or not exists subquery generates SQL with syntax error

    XMLWordPrintableJSON

Details

    • Sub-task
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • None
    • None

    Description

      Table aliase resolution is still a problem in the following JPQL queries when query contains subqueries using select count(o) or not exists:

      1. "select o from Order o where o.amount > (select count(o) from Order o)",
      "select o from Order o where o.amount > (select count(o2) from Order o2)",
      2. "select c from Customer c left join c.orders p where not exists"
      + " (select o2 from c.orders o2 where o2 = o",

      the generated incorrect SQL has an empty FROM body, for example:
      {SELECT t0.oid, t0.amount .. FROM WHERE ( t0.amount > (select count(....

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              fancy Catalina Wei
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated: