Envers - problem with mapping relation when using mixed inheritance strategy

Description

For the mapping like that:

<hibernate-mapping>
<class abstract="true" name="AbstractActivity"
table="ACTIVITY">
<id name="id" type="integer">
<generator class="assigned"/>
</id>

<discriminator column="ACTIVITY_TYPE" type="string" length="20"/>

<property name="sequenceNumber" type="int" not-null="true"/>

<subclass abstract="true"
name="AbstractCheckActivity">
<join table="ACTIVITY_CHECK">
<key foreign-key="FK_CHKACT_ACT" not-null="true" column="ACTIVITY_ID"/>
<property name="durationInMinutes" type="int" not-null="true" column="DURATION_IN_MINUTES"/>
<many-to-one name="relatedActivity"
cascade="merge"
foreign-key="FK_CHKACT_RELACT"
class="AbstractActivity"
lazy="proxy">
<column name="RELATED_ACTIVITY_ID" not-null="false"/>
</many-to-one>
</join>
<subclass name="CheckInActivity"
discriminator-value="CHECK_IN"/>
</subclass>

<subclass name="NormalActivity"
discriminator-value="NORMAL"/>
</class>

</hibernate-mapping>

Envers generates improper audit table configuration for AbstractCheckActivity:

<hibernate-mapping auto-import="false">
<subclass entity-name="AbstractCheckActivity_AUD" discriminator-value="AbstractCheckActivity" table="ACTIVITY_AUD" extends="AbstractActivity_AUD">
<join table="ACTIVITY_CHECK_AUD">
<key>
<column name="ACTIVITY_ID" length="255" scale="2" precision="19"/>
<column name="REV"/>
</key>
<property name="durationInMinutes" insert="true" update="false" type="integer">
<column name="DURATION_IN_MINUTES" length="255" scale="2" precision="19"/>
</property>
<properties name="relatedActivity">
<property name="relatedActivity_id" insert="true" update="false" type="integer">
<column name="RELATED_ACTIVITY_ID" length="255" scale="2" precision="19"/>
</property>
</properties>
</join>
</subclass>
</hibernate-mapping>

This is not a valid mapping document, because properties tag is not allowed within join. The resulting schema doesn't contain column RELATED_ACTIVITY_ID -> this property is always null for historic data (as read by AuditReader).
The problem won't occur if I use joined-subclass inheritance strategy for the hierarchy, but it's not desirable here.

Environment

3.6.0.Final
Oracle10g

Status

Assignee

AdamA

Reporter

Michał Skowronek

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

3.6.7
4.0.0.Alpha2

Priority

Major
Configure