[JIRA] (HHH-16189) Hibernate 6, wrong order by and group by generated with MappedSuperclass and Generics
by Jones (JIRA)
Jones ( https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%... ) *commented* on HHH-16189 ( https://hibernate.atlassian.net/browse/HHH-16189?atlOrigin=eyJpIjoiZThmYT... )
Re: Hibernate 6, wrong order by and group by generated with MappedSuperclass and Generics ( https://hibernate.atlassian.net/browse/HHH-16189?atlOrigin=eyJpIjoiZThmYT... )
I would like to add that I’m facing the same issue with Oracle:
When I have an entity with multiple subclasses using a single table and discriminator, I get the same issue… The select has all properties from all sub-classes, but the group by is missing, which causes issues in oracle:
Hibernate:
select
sum(m1_0.amount),
r1_0.ID,
r1_0.DISC_COL,
r1_0.RELATED_VALUE,
r1_0.ONLY_CHILD_ONE,
r1_0.ONLY_CHILD_TWO
from
MY_TABLE m1_0
join
MY_TABLE r1_0
on r1_0.ID=m1_0.REL_ENTITY
where
1=1
group by
r1_0.ID,
r1_0.DISC_COL,
r1_0.RELATED_VALUE
I’m attaching a test case for it just as a reference
HHH-16XX1.zip ( https://hibernate.atlassian.net/secure/attachment/50243/50243_HHH-16XX1.zip )
( https://hibernate.atlassian.net/browse/HHH-16189#add-comment?atlOrigin=ey... ) Add Comment ( https://hibernate.atlassian.net/browse/HHH-16189#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=EmailN... ) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100217- sha1:f4229d0 )
1 year, 10 months