Gavin King (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiZmY4Y2IxMDU1...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-16584?atlOrigin=eyJpIjoiZmY4Y2...
) HHH-16584 (
https://hibernate.atlassian.net/browse/HHH-16584?atlOrigin=eyJpIjoiZmY4Y2...
) @JoinTable @ManyToOne should have a unique constraint on association tab;e (
https://hibernate.atlassian.net/browse/HHH-16584?atlOrigin=eyJpIjoiZmY4Y2...
)
Issue Type: Bug Assignee: Unassigned Components: hibernate-core Created: 11/May/2023 01:32
AM Priority: Major Reporter: Gavin King (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
)
A mapping like this:
static class Book {
@Id @GeneratedValue long id;
@ManyToOne
@JoinTable(name= "BOOKPUBLISHER" )
Publisher publisher;
}
Results in this DDL:
create table BOOKPUBLISHER (
publisher_id bigint ,
id bigint not null ,
primary key (id)
)
But the id column should have a unique constraint.
The same issue occurs for @OneToOne , where both columns should have unique constraints,
but only one unique constraint is added.
(
https://hibernate.atlassian.net/browse/HHH-16584#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16584#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#100225- sha1:84d3b45 )