Andrei Nikulin (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiZTg3NDdlNWY3...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-17038?atlOrigin=eyJpIjoiZTg3ND...
) HHH-17038 (
https://hibernate.atlassian.net/browse/HHH-17038?atlOrigin=eyJpIjoiZTg3ND...
) Error executing query in H6.2.7 (InterpretationException) (
https://hibernate.atlassian.net/browse/HHH-17038?atlOrigin=eyJpIjoiZTg3ND...
)
Issue Type: Bug Assignee: Unassigned Created: 07/Aug/2023 01:45 AM Priority: Major
Reporter: Andrei Nikulin (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
)
I have an issue migrating some code to Hibernate 6.2 from 5,
and get an exception saying
org.hibernate.query.sqm.InterpretationException: Error interpreting query [from
UserTranslation where classifier.id=?1] ; this may indicate a semantic (user query)
problem or a bug in the parser [from UserTranslation where classifier.id=?1]
The model is as follows:
@MappedSuperclass
public abstract class AbstractEntity<ID> {
public abstract ID getId();
}
@Entity
@Table(name = "USERS" )
public class User extends AbstractEntity< Long > implements WithTranslationKey {
@Id
@GeneratedValue
private Long id;
private String name;
/* boilerplate..... */
}
@MappedSuperclass
public abstract class AbstractTranslationEntity<T extends AbstractEntity< Long >
& WithTranslationKey>
extends AbstractEntity< Long > {
@Id
@GeneratedValue
private Long id;
@JoinColumn(name = "CLASSIFIER_ID" , nullable = false )
@ManyToOne(fetch = FetchType.LAZY, optional = false )
private T classifier;
@Column(name = "LOCALE_CODE" , length = 15, nullable = false )
private String localeCode;
/* boilerplate..... */
}
@Entity
@Table(name = "USER_TRANSLATION" )
public class UserTranslation extends AbstractTranslationEntity<User> {
private String translation;
/* boilerplate..... */
}
The failing query is:
List<?> resultList = entityManager.createQuery("from UserTranslation where
classifier.id=?1")
.setParameter(1, user1.getId())
.getResultList();
Passing test with Hibernate 5 dependency: Branch h5-passing (
https://github.com/NikulinAndrei/spring-boot-3-test/tree/h5-passing )
Failing test with Hibernate 6 dependency: Branch h6-failing (
https://github.com/NikulinAndrei/spring-boot-3-test/tree/h6-failing )
(
https://hibernate.atlassian.net/browse/HHH-17038#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-17038#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#100233- sha1:2faa3a6 )