Bug 1154212
| Summary: | (6.4.0) [HHH-9390] Default join column name (FK) for @ManyToMany uses owning entity primary table name | |||
|---|---|---|---|---|
| Product: | [JBoss] JBoss Enterprise Application Platform 6 | Reporter: | Gail Badner <gbadner> | |
| Component: | Hibernate | Assignee: | Gail Badner <gbadner> | |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Jan Martiska <jmartisk> | |
| Severity: | unspecified | Docs Contact: | ||
| Priority: | unspecified | |||
| Version: | 6.3.2 | CC: | cdewolf, jmartisk, kkhan, msimka, smarlow | |
| Target Milestone: | DR11 | |||
| Target Release: | EAP 6.4.0 | |||
| Hardware: | Unspecified | |||
| OS: | Unspecified | |||
| Whiteboard: | dev_blocker | |||
| Fixed In Version: | Doc Type: | Bug Fix | ||
| Doc Text: | Story Points: | --- | ||
| Clone Of: | ||||
| : | 1157597 (view as bug list) | Environment: | ||
| Last Closed: | Type: | Bug | ||
| Regression: | --- | Mount Type: | --- | |
| Documentation: | --- | CRM: | ||
| Verified Versions: | Category: | --- | ||
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
| Cloudforms Team: | --- | Target Upstream Version: | ||
| Embargoed: | ||||
| Bug Depends On: | ||||
| Bug Blocks: | 1121629, 1157597 | |||
|
Description
Gail Badner
2014-10-17 21:57:07 UTC
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 |