Setting foreign key name on @CollectionTable has no effect

Description

Setting foreign key name using JPA @ForeignKey annotation on field annotated by @CollectionTable has no effect in generated schema.

Exported schema:

As a workaround it's possible to name foreign key by deprecated @org.hibernate.annotations.ForeignKey annotation.

Attachments

1

Activity

Show:

Antonio Anzivino January 5, 2017 at 3:17 PM

Hello, I am facing this problem in 5.1.3.Final. Asking to reopen. No test case attached as my example follows the above code and my FK name is autogenerated. In my case I have a Set<String> collection.

I am currently unable (Java 7) to upgrade to Hibernate 5.2.x. Is it possible to port the fix to the 5.1.x branch too?

Thanks.

Steve Ebersole October 21, 2016 at 6:11 PM

Sorry for the ping. Apparently at some stage this was fixed upstream too and not just on the metamodel branch. verified that this works on 5.2.3 and the newest 5.2.4 snapshots. But not sure where this was applied. So let's just resolve this as out-of-date for now.

Steve Ebersole October 21, 2016 at 6:05 PM

Brett, if you want to look at porting this to master for 5.2 I certainly will not complain If not, just assign to me. Thanks!

Brett Meyer January 14, 2014 at 4:40 PM

, good catch, but:

This whole area is pretty screwed up. I'm committing a failing unit test and will address in ORM 5, which we're focusing on after this week (hopefully).

Out of Date

Details

Assignee

Reporter

Affects versions

Priority

Created January 14, 2014 at 12:18 PM
Updated January 5, 2017 at 5:59 PM
Resolved October 21, 2016 at 6:11 PM