Christian Beikov (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *closed* an issue as *Rejected*
That's not a bug, but this is just how inheritance works in Hibernate/JPA. The primary
key of an entity must be unique across the entity hierarchy. If you persist a Book with id
1 and then try to read a BorrowedBook with id 1 your modelling is simply wrong.
BorrowedBook should not extend the entity Publication as it is not a special type, but a
different thing entirely.
You'll have to map the things separately and stop fearing "duplication" or
map everything through `@Embeddable` parts. Another possible way to go forward is to stop
using database views and instead rely on DTOs and queries instead of managed entities.
Maybe take a look at Blaze-Persistence Entity-Views.
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiMzcwYzYxMzc2...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-15268?atlOrigin=eyJpIjoiMzcwYz...
) HHH-15268 (
https://hibernate.atlassian.net/browse/HHH-15268?atlOrigin=eyJpIjoiMzcwYz...
) View entity with shared @MappedSuperclass extending @Inheritance entity not supported (
https://hibernate.atlassian.net/browse/HHH-15268?atlOrigin=eyJpIjoiMzcwYz...
)
Change By: Christian Beikov (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) Resolution: Rejected Status: Open Closed
(
https://hibernate.atlassian.net/browse/HHH-15268#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-15268#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:5147d46 )