Gavin King (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiMjQxZTRjYWJm...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-15627?atlOrigin=eyJpIjoiMjQxZT...
) HHH-15627 (
https://hibernate.atlassian.net/browse/HHH-15627?atlOrigin=eyJpIjoiMjQxZT...
) useless error message of multi-@JoinColumn mapping does not specify referencedColumnName
(
https://hibernate.atlassian.net/browse/HHH-15627?atlOrigin=eyJpIjoiMjQxZT...
)
Issue Type: Bug Affects Versions: 6.1.4 Assignee: Unassigned Components: hibernate-core
Created: 25/Oct/2022 06:48 AM Priority: Major Reporter: Gavin King (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
)
Consider:
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name = "ID" , referencedColumnName = "TID" , insertable
= false , updatable = false )
@JoinColumn(name = "TOC_ID" , referencedColumnName = "SECTION_ID" ,
insertable = false , updatable = false )
@JoinColumn(name = "SECTION_NUMBER_NB" , insertable = false , updatable =
false )
ReportSection sourceTocSlide;
The third resulting @JoinColumn is missing a referencedColumnName (easy to miss).
The error is:
org.hibernate.MappingException: Logical column name cannot be null
That’s … pretty bad.
(
https://hibernate.atlassian.net/browse/HHH-15627#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-15627#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:9aa9d1d )