Vincent Bouthinon (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=70121%3...
) *updated* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiNGJmNWRjMjIz...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-16882?atlOrigin=eyJpIjoiNGJmNW...
) HHH-16882 (
https://hibernate.atlassian.net/browse/HHH-16882?atlOrigin=eyJpIjoiNGJmNW...
) Invalid alias in a @Where clause with @Inheritance(JOINED) (
https://hibernate.atlassian.net/browse/HHH-16882?atlOrigin=eyJpIjoiNGJmNW...
)
Change By: 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-clau...]
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”.
{code:java}@Inheritance(JOINED)
@Entity @Where(clause="qux=0")
public class Baz {
private int qux= 0;
}
@Entity
public class Bar extends Baz {
}
@Entity
public class Foo {
Set<Bar> setOf;
}{code}
{ code:sql noformat }select qux Bar join Baz where Bar.qux=0{ code noformat }
-Bar.qux=0- => Baz.qux=0
I will create a pull request (PR) to reproduce it.
Best regards
(
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 )