Audit tables storing incorrect discriminator value when using JOINED entity inheritance.

Description

Using the following entity configuration:

ParentEntity.java

ChildEntity.java

Hibernate will insert *child* as the discriminator value on the ORM side; however, the fully qualified class name of the audited entity will be used in the envers audit tables.

In Hibernate 4.3.11.Final, this wasn't observed and the actual configured discriminator value was used instead. This also introduces a column width problem as column width is configured based on the expected configured values, which are often far shorter than the fully qualified name; causing insertion failures on the Envers side.

Environment

None

Activity

Show:
Chris Cranford
September 26, 2016, 7:35 PM
Edited

The main reason for this regression is that ORM5 didn't provide support for discriminator-value attributes on joined-subclass HBM mapping elements.

The provided PR will introduce this change, allowing the discriminator values to be properly set on the persisters for the audit entities and therefore properly set at the table level to address this regression.

Gail Badner
September 29, 2016, 4:36 AM

Fixed in master.

Gail Badner
June 9, 2017, 10:22 PM

Fixed in 5.1 branch as well.

Assignee

Chris Cranford

Reporter

Chris Cranford

Fix versions

Labels

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure