Murilo Carlos Cardoso (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5f2056e...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiYTQ3YjExNzU2...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-14123?atlOrigin=eyJpIjoiYTQ3Yj...
) HHH-14123 (
https://hibernate.atlassian.net/browse/HHH-14123?atlOrigin=eyJpIjoiYTQ3Yj...
) @ForeignKey(value = ConstraintMode.NO_CONSTRAINT)) doesn't work (
https://hibernate.atlassian.net/browse/HHH-14123?atlOrigin=eyJpIjoiYTQ3Yj...
)
Issue Type: Bug Assignee: Unassigned Components: hibernate-core Created: 28/Jul/2020 10:00
AM Environment: Hibernate version 5.4.18.Final.
OpenJDK 11
Linux Mint 19
Postgres Priority: Major Reporter: Murilo Carlos Cardoso (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=5f2056e...
)
@JoinColumn(foreignKey = @ForeignKey(value = ConstraintMode.NO_CONSTRAINT)) doesn't
work.
Example:
public class ClassA {
@Id
private String id;
@NotNull
private String someProperty;
@OneToMany(mappedBy = " classA " )
private Set<ClassB> bs;
}
public class ClassB {
@Id
private String id;
@NotNull
private String someProperty;
@ManyToOne
@JoinColumn(foreignKey = @ForeignKey(value = ConstraintMode.NO_CONSTRAINT))
private ClassA classA ;
}
When the application starts it still creates the fks, although I have explicit configure
to not.
create table class_a (id varchar(255) not null , some_property varchar(255), primary key
(id));
create table class_b (id varchar(255) not null , some_property varchar(255), class_a_id
varchar(255), primary key (id));
alter table if exists class_b add constraint FKjpk05raxduof60eee8p6khbch foreign key
(class_a_id) references class_a
application.properties
spring.datasource.url=jdbc:postgresql: //localhost:5432/my-spring-data-sample
spring.datasource.username=postgres
spring.datasource.password=***
spring.jpa.hibernate.ddl-auto=create-drop
spring.jpa.generate-ddl= true
spring.jpa.show-sql= true
spring.jpa.database-platform=org.hibernate.dialect.PostgreSQL95Dialect
(
https://hibernate.atlassian.net/browse/HHH-14123#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-14123#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#100140- sha1:454f3ac )