Uploaded image for project: 'Hibernate ORM'
  1. HHH-8447

HQL delete with multiple subqueries failing (incorrect alias used)

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 4.3.0.Beta4, 4.2.5
    • Component/s: None
    • Labels:
      None
    • Bug Testcase Reminder (view):

      Bug reports should generally be accompanied by a test case!

    • Last commented by a user?:
      true
    • Sprint:

      Description

      The HQL:

      DELETE FROM Panel panelEntity WHERE
          panelEntity.posterCampaignId = osterCampaignId
          AND panelEntity.framePackagePrintId IS NULL
          AND panelEntity.clientId IN ( SELECT trtPanel.clientId FROM TrtPanel trtPanel )
          AND panelEntity.deltaStamp NOT IN SELECT trtPanel.deltaStamp FROM TrtPanel trtPanel )
      

      The generated SQL:

      delete from PRD_PANEL where
          PPA_POSTER_CAMPAIGN_ID=?
          and (PPA_FRAME_PACKAGE_ID_PRINT is null)
          and (PPA_CLIENT_ID in (select trtpanel1_.TTP_CLIENT_ID from TEMP_TRT_PANEL trtpanel1_))
          and (panel0_.PPA_DELTA_STAMP not in  (select trtpanel2_.TTP_DELTA_STAMP from TEMP_TRT_PANEL trtpanel2_))
      

      The panel0_ alias is stripped from the from element (as it should be), but is remaining on the 2nd where clause.

        Attachments

          Activity

            People

            • Assignee:
              brmeyer Brett Meyer
              Reporter:
              brmeyer Brett Meyer
              Participants:
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: