Marco Belladelli (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=637b480...
) *commented* on HHH-15922 (
https://hibernate.atlassian.net/browse/HHH-15922?atlOrigin=eyJpIjoiNjE3ZG...
)
Re: MappingException is thrown for @JoinColumn with referencedColumnName on a
@SecondaryTable - Composite Key (
https://hibernate.atlassian.net/browse/HHH-15922?atlOrigin=eyJpIjoiNjE3ZG...
)
Hello Marco Sabato (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) , thanks for reporting the issue and providing a reproducer!
I did some tests and looks like the problem is you’re trying to create an association to
two @JoinColumn}}s that span 2 different tables: {{GSBER is in the
CountryEntityCompositeKey primary table ( HDLNDP ), while ( HCSLN ) is in its secondary
table HDCNTP (though the mapping is a bit confusing and I might be wrong, I actually
renamed all tables and columns to make sense of the example).
Joining with multiple columns that are not in the same table is not allowed and, even
though the error is a bit misleading, it's not related to the @SecondaryTable key
being Composite. I also tested with 5.6 to be sure and the error is the same.
(
https://hibernate.atlassian.net/browse/HHH-15922#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-15922#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#100214- sha1:b03f6a4 )