Grim Oire (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiOWMxNDdhODJh...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-15675?atlOrigin=eyJpIjoiOWMxND...
) HHH-15675 (
https://hibernate.atlassian.net/browse/HHH-15675?atlOrigin=eyJpIjoiOWMxND...
) LEFT JOIN in HQL creates CROSS-JOINS in SQL disabling "WHERE 1=1 OR "-wavebys
(
https://hibernate.atlassian.net/browse/HHH-15675?atlOrigin=eyJpIjoiOWMxND...
)
Issue Type: Bug Affects Versions: 5.4.28 Assignee: Unassigned Components: query-hql
Created: 05/Nov/2022 05:01 AM Environment: Hibernate-Core 5.4.28, JDK16, Win, PostgreSQL
Priority: Critical Reporter: Grim Oire (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
)
I have a HQL-Query:
SELECT c.id as vcid,
c.hexValue as hv
FROM VisualColor c LEFT JOIN c.dataKontorFolders dkf
LEFT JOIN c.phases p
LEFT JOIN p.bugs b
LEFT JOIN b.reporteds bugrep
LEFT JOIN bugrep.project.projectgroup.ownedByOrganizations brownorg
WHERE 1=1 OR
dkf.dataKontor.dataKontorUsergroup.organization = :o
Since I wrote 1=1 I expect to have all rows from VisualColor but I got none.
The constructed query is:
select
visualcolo0_."id" as vcid,
visualcolo0_."hex_value" as hv
from "VISUAL_COLOR" visualcolo0_ left
outer join "DATA_KONTOR_FOLDER" datakontor1_ on
visualcolo0_."id"=datakontor1_."visual_color_fk"
left outer join "PHASE" phases2_ on
visualcolo0_."id"=phases2_."tinge"
left outer join "BUG" bugs3_ on
phases2_."id"=bugs3_."current_phase_fk"
left outer join "REPORT_CAUSED_BY__BUG" reporteds4_ on
bugs3_."id"=reporteds4_."bugs_id"
left outer join "REPORT" report5_ on
reporteds4_."reported_id"=report5_."id"
left outer join "PROJECT" project6_ on
report5_."project_fk"=project6_."id"
left outer join "PROJECT_GROUP" projectgro7_ on
project6_."projectgroup_fk"=projectgro7_."id"
left outer join "ORGANIZATION_OWNS__PROJECTGROUP" ownedbyorg8_ on
projectgro7_."id"=ownedbyorg8_."owning_projectgroups_id"
left outer join "ORGANIZATION" organizati9_ on
ownedbyorg8_."owned_by_organizations_id"=organizati9_."id"
cross join "DATA_KONTOR" datakontor10_
cross join "USERGROUP" usergroup11_
where
datakontor1_."data_kontor_fk"=datakontor10_."id" and
datakontor10_."data_kontor_usergroup_fk"=usergroup11_."id"
and (
1=1
or usergroup11_."organization_fk"=?
)
Please help
(
https://hibernate.atlassian.net/browse/HHH-15675#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-15675#add-comment?atlOrigin=ey...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100210- sha1:21ade21 )