From c0528b7079e2478facd9f734fd4e15bb64e8f116 Mon Sep 17 00:00:00 2001 From: Andrea Boriero Date: Thu, 12 Nov 2015 20:14:02 +0000 Subject: [PATCH] HHH-10247 - Fix Hibernate ignores foreign-key attribute name in hbm --- .../hibernate/boot/model/source/internal/hbm/ModelBinder.java | 1 + 1 file changed, 1 insertion(+) diff --git a/hibernate-core/src/main/java/org/hibernate/boot/model/source/internal/hbm/ModelBinder.java b/hibernate-core/src/main/java/org/hibernate/boot/model/source/internal/hbm/ModelBinder.java index 812e8aecdc..3b213e54ce 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/model/source/internal/hbm/ModelBinder.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/model/source/internal/hbm/ModelBinder.java @@ -3570,6 +3570,7 @@ public class ModelBinder { : FetchMode.JOIN ); + elementBinding.setForeignKeyName( elementSource.getExplicitForeignKeyName() ); elementBinding.setReferencedEntityName( elementSource.getReferencedEntityName() ); if ( StringHelper.isNotEmpty( elementSource.getReferencedEntityAttributeName() ) ) {