Inherited interfaces are not considered when creating EntityMetamodel

Description

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:

Environment

None

Activity

Show:
Chris Cranford
March 7, 2017, 2:49 PM

It seems setters are also affected, so I'll address both getter & setter scenarios.

Steve Ebersole
March 7, 2017, 3:40 PM
Edited

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.

Jones
March 7, 2017, 6:38 PM

Here: https://docs.jboss.org/hibernate/orm/4.3/manual/en-US/html_single/#mapping-declaration-class

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.

Steve Ebersole
March 7, 2017, 7:15 PM

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.

Fixed

Assignee

Chris Cranford

Reporter

Jones

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Affects versions

Priority

Major
Configure