Vincent Bouthinon (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=70121%3...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiMGJmMDEzY2M2...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-16882?atlOrigin=eyJpIjoiMGJmMD...
) HHH-16882 (
https://hibernate.atlassian.net/browse/HHH-16882?atlOrigin=eyJpIjoiMGJmMD...
) Invalid alias in a @Where clause with @Inheritance(JOINED) (
https://hibernate.atlassian.net/browse/HHH-16882?atlOrigin=eyJpIjoiMGJmMD...
)
Issue Type: Bug Affects Versions: 6.2.3 Assignee: Unassigned Created: 03/Jul/2023 02:05 AM
Priority: Major Reporter: Vincent Bouthinon (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=70121%3...
)
Hi,
I posted a thread on the forum :
Invalid alias in a @Where clause with @Inheritance(JOINED) - Hibernate ORM - Hibernate (
https://discourse.hibernate.org/t/invalid-alias-in-a-where-clause-with-in...
)
The issue is that if I have a model with a JOINED class hierarchy, and I have a predicate
in the @Where annotation that references an attribute of the parent class, Hibernate
automatically assigns the alias to the child class instead of the parent class..
This scenario occurs when an object "Foo" has a collection of objects
"Bar" that inherit from the class "BAZ," which has an attribute
"qux" and the "@Where" annotation that adds a predicate on
"qux".
During the loading of the collection “Bar” of the object “Foo”.
@Inheritance(JOINED)
@Entity @Where(clause= "qux=0" )
class Baz {
private int qux= 0;
}
@Entity
class B extends A { }
@Entity class C { Set<B> setOf; }
(
https://hibernate.atlassian.net/browse/HHH-16882#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16882#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#100228- sha1:e911e2c )