@JoinColumn's foreign key custom name does not work with @MapsId

Description

In the following example:

the

has ho effect but I expect the foreign key to get the custom name "fk_post". Instead the FK name is randomly generated.

The one-to-one relationship is uni-directional. The code is taken from "The best way to map a @OneToOne relationship with JPA and Hibernate" post (section "The most efficient mapping").

I also created question on SO.

Environment

Hibernate 5.2.13
PostgreSQL 9.6
Java version "1.8.0_102" OpenJDK 1.8
Fedora release 24

Assignee

Chris Cranford

Reporter

Nikolay Georgiev

Fix versions

backPortable

Backport?

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure