stendler (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5b83900...
) *commented* on HHH-12930 (
https://hibernate.atlassian.net/browse/HHH-12930?atlOrigin=eyJpIjoiOWZmM2...
)
Re: non-primary embedded composite @ManyToOne mapping fails -> AnnotationException:
referencedColumnNames ... not mapped to a single property (
https://hibernate.atlassian.net/browse/HHH-12930?atlOrigin=eyJpIjoiOWZmM2...
)
It’s been a while, but, if I recall correctly, the example is missing/assumes a different
attribute being the primary key. E.g.:
@Id
private int id;
With that, the @NaturalId cannot be an @EmbeddedId. Though, it should still be possible to
map entities using a (non-primary) embedded composite natural key.
I’ve reconstructed a test case using the template (
https://github.com/hibernate/hibernate-test-case-templates/tree/main/orm/...
). The @ManyToOne -Mapping actually does work with the NaturalId, if it is not an
embeddable and its composite attributes are direct attributes of the Region-Entity instead
(corresponding working code included as comments).
hhh-12930-hibernate-orm-6.zip (
https://hibernate.atlassian.net/secure/attachment/50086/50086_hhh-12930-h...
)
(
https://hibernate.atlassian.net/browse/HHH-12930#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-12930#add-comment?atlOrigin=ey...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100209- sha1:6031644 )