Bug 1114699

Summary: [GSS](6.4.0)HHH-9387 Join table name for @ElementCollection uses entity class name instead of specified entity name
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Stephen Fikes <sfikes>
Component: HibernateAssignee: Gail Badner <gbadner>
Status: CLOSED CURRENTRELEASE QA Contact: Martin Simka <msimka>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 6.2.0CC: cdewolf, dandread, gbadner, kkhan, msimka, smarlow
Target Milestone: DR11   
Target Release: EAP 6.4.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Known Issue
Doc Text:
This release of JBoss EAP 6 carries a bug that in the Hibernate component that causes the table name computed for an @ElementCollection to use the entity class name instead of the specified entity name. This issue is under investigation and is expected to be resolved in a future release of the product.
Story Points: ---
Clone Of:
: 1117447 1132207 (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: 1117447, 1121629, 1132207, 1134738    
Attachments:
Description Flags
Maven based testcase none

Description Stephen Fikes 2014-06-30 17:15:36 UTC
Description of problem:
The table name computed for an @ElementCollection of @Embeddable uses the entity name instead of entity table 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 a entity which differs from the entity name:

@Entity
@Table(name = "prod")
public class Product {
    ...
}

2. Add collection of embeddable to the above entity
    @ElementCollection(fetch = FetchType.EAGER)
    private Set<Part> parts = new TreeSet<Part>();

Actual results:
Hibernate 4 computes the join table name as Product_parts

Expected results:
The table name should be prod_parts

Additional info:
- Hibernate 3 (which used @CollectionOfElements rather than @ElementCollection) computed the join table name as prod_parts
- This may be the same as https://hibernate.atlassian.net/browse/HHH-5417

Comment 1 Stephen Fikes 2014-06-30 17:22:35 UTC
Created attachment 913499 [details]
Maven based testcase

Comment 6 Gail Badner 2014-07-02 20:21:29 UTC
Corrected doc text.

Comment 9 Gail Badner 2014-07-08 02:29:01 UTC
Yes, please do. Thanks.

Comment 10 Gail Badner 2014-07-09 21:56:20 UTC
I don't think HHH-5417 is accurate any more. I've created a new Jira issue to reflect the current behavior:

https://hibernate.atlassian.net/browse/HHH-9280

Comment 11 sgilda 2014-07-30 12:25:36 UTC
Based on this comment in Bug 1119658:

    I noticed that two bugzillas representing the same issue are now in the release notes: 1114699 and 1117447 represent the same issue, but are targeted for a different EAP version. One of them should be removed from the release notes.

This one is targeted for 6.4, so removing the requires_doc_text flag on this bug.

Comment 12 Gail Badner 2014-11-21 02:55:52 UTC
Fixed for EAP 6.4.0

Comment 13 Gail Badner 2014-11-21 02:59:19 UTC
HHH-9280 was reverted by HHH-9327. Instead this is fixed by https://hibernate.atlassian.net/browse/HHH-9387 .

Comment 14 Kabir Khan 2014-11-21 11:35:13 UTC
Fixed by Hibernate 4.2.16.Final upgrade https://bugzilla.redhat.com/show_bug.cgi?id=1121629

Comment 15 Martin Simka 2014-11-27 12:00:54 UTC
verified on EAP 6.4.0.DR11 / Hibernate 4.2.16