Migrating from hibernate 4.3 to hibernate 5.2.8.Final I encountered the following issue:
The hibernate mapping is done using hbm.xml files:
MyRealEntity implements MyEntity interface.
MyEntity interface extends Common interface
Common interface extends Entity interface
Entity interface has getId() and setId(...)
Please find a unit test with the issue:
It seems setters are also affected, so I'll address both getter & setter scenarios.
do you have a link to some documentation stating that this was a supported feature in 4.3? Unless I simply don't remember, mapping interfaces is something we have never supported at all, even in HBM (its explicitly not supported by JPA).
It is still a reasonable request, but this helps categorize it. If there is documentation as of 4.3 that shows this is supported then this is a regression (bug). However, if there is no such documentation then this is simply a RFE which has different ramifications.
name (optional): the fully qualified Java class name of the persistent class or interface. If this attribute is missing, it is assumed that the mapping is for a non-POJO entity.
That states that I can use class or interface when using
What I can say is that it works without any issue in hibernate 4.3.
Whether something happened to work versus guaranteed to work is a a huge difference. We considered guaranteed as meaning it is documented to work as such.
Anyway, since this was documented to work we will treat it as a regression/bug.