many-to-one id="true" is not picked up by hibernate in orm.xml

Description

When making a composite key referring to a target entity something like the following ORM XML should be defined:

<?xml version="1.0" encoding="UTF-8"?>
<entity-mappings xmlns="http://java.sun.com/xml/ns/persistence/orm"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm_2_0.xsd"
version="2.0">
<entity class="Subscription">
<table name="SUBSCRIPTION"/>
<id-class class="SubscriptionKey"/>
<attributes>
...
<many-to-one name="owner" id="true">
<join-column name="FK_SUBSCRIBER_CVR"/>
</many-to-one>
</attributes>
</entity>
</entity-mappings>

But for some reason the id attribute is not picked up by Hibernate, and therefore it does not interpret the relation as a primary key. A workaround is to add a id tag referring to the same property, but it would be nice of Hibernate would pick up the id attribute on the many-to-one relation.

Environment

None

Assignee

Unassigned

Reporter

Rolf Thunbo

Labels

None

Feedback Requested

None

Feedback Requested By

None

backPortable

None

Suitable for new contributors

None

Pull Request

None

backportDecision

None

backportReEvaluate

None

Priority

Major
Configure