Oleksii Miroshnyk (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5a157d9...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiYWRkNGFiNGJi...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-16824?atlOrigin=eyJpIjoiYWRkNG...
) HHH-16824 (
https://hibernate.atlassian.net/browse/HHH-16824?atlOrigin=eyJpIjoiYWRkNG...
) JPQL IN clause gives error if you use interface for entity Could not locate TableGroup (
https://hibernate.atlassian.net/browse/HHH-16824?atlOrigin=eyJpIjoiYWRkNG...
)
Issue Type: Bug Affects Versions: 6.2.5 Assignee: Unassigned Components: hibernate-core
Created: 20/Jun/2023 03:54 AM Priority: Major Reporter: Oleksii Miroshnyk (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5a157d9...
)
So let’s say I have 2 queries:
String queryStr = "SELECT entity" +
" FROM org.hibernate.bugs.IEntityB entity" +
" WHERE entity.id=:myId";
org.hibernate.bugs.IEntityB is interface
and it words fine
if I do
String queryStr = "SELECT entity" +
" FROM org.hibernate.bugs.IEntityB entity" +
" WHERE entity.id IN :myId";
So the only thing that was changed is IN clause instead of =
it gives me the error
org.hibernate.sql.ast.SqlTreeCreationException: Could not locate TableGroup -
org.hibernate.bugs.IEntityB(entity)
Bot queries work fine if I use entity class instead of interface.
It also fails if I do MAX function like this
String queryStr = "SELECT MAX(entity.number)" +
" FROM org.hibernate.bugs.IEntityB entity" +
" WHERE entity.id=:myId";
(
https://hibernate.atlassian.net/browse/HHH-16824#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16824#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#100227- sha1:8ffa416 )