We're updating the issue view to help you get more done. 

HQL delete with multiple subqueries failing (incorrect alias used)

Description

The HQL:

1 2 3 4 5 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:

1 2 3 4 5 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.

Environment

None

Status

Assignee

Brett Meyer

Reporter

Brett Meyer

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Priority

Major