Description of problem: Version-Release number of selected component (if applicable): How reproducible: Steps to Reproduce: 1. 2. 3. Actual results: Expected results: Additional info:
Description of problem: The foreign key column name computed for a unidirectional @ManyToMany uses the owner table name instead of the owner entity name. Version-Release number of selected component (if applicable): Hibernate core 4.2 and later How reproducible: Consistently Steps to Reproduce: 1. Provide a table name for an entity that differs from the entity name. @Entity @Table(name="tbl_city") public class City { @Id private Integer id; @ManyToMany private Set<Item> stolenItems; .... } Actual results: Hibernate 4 computes the foreign key column name as tbl_city_id Expected results: The foreign key column name should be City_id. Additional info: See https://hibernate.atlassian.net/browse/HHH-9390.
Fixed for EAP 6.4.0.
Fixed by Hibernate 4.2.16.Final upgrade https://bugzilla.redhat.com/show_bug.cgi?id=1121629
Verified in EAP 6.4.0.DR11 / hibernate 4.2.16.Final-redhat-1.
Note: the reproducer is available here: https://bugzilla.redhat.com/show_bug.cgi?id=1157597