'Duplicate table mapping' error after upgrade from Hibernate 4.2 to Hibernate 5

Description

We have a JPA entity model which consists of two different entities which are mapped to the same database table. The reason why two separate entities exists is that we use them in two separate parts of the application (separate application modules) and they differ in attributes which they hold. This scenario was working perfectly in Hibernate 4.2.18.

After upgrade to 5.2.10 (JPA 2.1), we started experiencing the DuplicateMappingException: Duplicate table mapping, which occurs on the application startup. The entities are defined as follows:

The exception we receive is:

Although we run this application on WebSphere, we do not use the default (built-in) Java Persistence provider.

Thanks in advance for any insight and suggestions.

Environment

WebSphere AS 9.0 (Classic Edition) + Oracle 12c

Status

Assignee

Unassigned

Reporter

Stanislav Novák

Fix versions

None

Labels

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Worked in

4.2.19

Components

Affects versions

Priority

Major
Configure