amit mahajan (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiOGZjNTkyZGI4...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-16381?atlOrigin=eyJpIjoiOGZjNT...
) HHH-16381 (
https://hibernate.atlassian.net/browse/HHH-16381?atlOrigin=eyJpIjoiOGZjNT...
) Hibernate inheritance using mapped superclass JPA query issue (
https://hibernate.atlassian.net/browse/HHH-16381?atlOrigin=eyJpIjoiOGZjNT...
)
Issue Type: Bug Affects Versions: 6.1.7 Assignee: Unassigned Components: hibernate-core,
metamodel, query-hql Created: 27/Mar/2023 06:30 AM Environment: Spring boot 3, JPA Labels:
JPA SQM inheritance spring-boot Priority: Major Reporter: amit mahajan (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) Original estimate: 64h Remaining Estimate: 64h
JPA queries involving MappedSuperclass are failing in latest Hibernate or Spring Boot 3
projects.The same worked fine in Spring boot 2 or Hibernate 5.
*Steps to reproduce:*
1. Create Mapped Superclass inheritance using XML in spring boot 3 project.
2. Create Jpa repository for base type.
3. Create JPA Query having Base class attributes
GitHub steps:
* Checkout repository
https://github.com/amitmahajanus/relationbook.git (
https://github.com/amitmahajanus/relationbook.git )
* run below command in the terminal in the project directory * mvn clean package
* mvn spring-boot:run
* compare the results after changing spring boot version to 2 and adding javax instead of
jakarta dependencies.
*Root cause:*
The SQM fails to find parent class attributes and project fails to load/run.
The same works fine with Spring Boot 2 or Hibernate 5 project.
*Impact:*
* Requiring to implement JpaRepository for each sub type and do lots of boiler plate code
(querying sub type tables combining data and filtering)
* Spring Boot 3 upgrade or Hibernate 6 upgrade / migration will fail.
Attacing a sample project github link (
https://github.com/amitmahajanus/relationbook.git
)
https://github.com/amitmahajanus/relationbook.git (
https://github.com/amitmahajanus/relationbook.git ).
Please compare spring boot 2 and spring boot 3 (having hibernate 5 and 6 respectively)
(
https://hibernate.atlassian.net/browse/HHH-16381#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16381#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#100219- sha1:ac3e918 )