We're updating the issue view to help you get more done. 

In a @OneToMany association with @JoinColum the @ForeignKey is not taken into consideration when generating the association database schema

Description

When declaring the mapping:

1 2 3 4 5 6 7 8 9 10 11 12 @Entity @Table(name = "USERS") public class User { @Id @GeneratedValue @Column(name = "USER_ID") private long id; @OneToMany(targetEntity = Group.class) @JoinColumn(name = "USER_ID", foreignKey = @ForeignKey(name = "FK_USER_GROUP")) private List<Group> groups; }
1 2 3 4 5 6 7 @Entity @Table(name = "GROUP") public class Group implements Serializable { @Id @Column(name = "GROUP_ID") private Long id; }

the @Foreignkey is not considered

Environment

None

Status

Assignee

Andrea Boriero

Reporter

Andrea Boriero

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

5.0.6

Priority

Major