Bug 1132207 - [GSS](6.4.0)HHH-9389 Foreign key column name for table mapping @ElementCollection uses entity class name instead of specified entity name
Summary: [GSS](6.4.0)HHH-9389 Foreign key column name for table mapping @ElementCollec...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Hibernate
Version: 6.2.0
Hardware: Unspecified
OS: Unspecified
unspecified
urgent
Target Milestone: DR11
: EAP 6.4.0
Assignee: Gail Badner
QA Contact: Martin Simka
URL:
Whiteboard:
Depends On: 1114699
Blocks: 1121629 1132212
TreeView+ depends on / blocked
 
Reported: 2014-08-20 22:02 UTC by Stephen Fikes
Modified: 2019-08-19 12:46 UTC (History)
4 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
In previous releases of JBoss EAP 6, the name attribute for @Entity(name="...") is ignored in computing the prefix for foreign key columns used to join the entity table to tables mapping @ElementCollection properties As a result, the computed foreign key prefix is the entity class name rather than the name supplied in the @Entity annotation In this release, the @Entity annotation name property is used to compute the foreign key name prefix. For example, the ``@Entity(name="prod")` public class Product will result in a computed foreign key (for the @ElementCollection table) with the prefix 'prod' rather than 'Product'.
Clone Of: 1114699
: 1132212 (view as bug list)
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)

Comment 2 Gail Badner 2014-11-21 03:05:23 UTC
https://hibernate.atlassian.net/browse/HHH-9389

Fixed for EAP 6.4.0.

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

Comment 4 Martin Simka 2014-11-27 11:59:44 UTC
verified on EAP 6.4.0.DR11 / Hibernate 4.2.16

Comment 6 Gail Badner 2015-04-01 19:03:11 UTC
This is very minor, but:

@Entity(name="prod") public class Product will result in a computed foreign key (for the @ElementCollection table) with the suffix 'prod' rather than 'Product' (e.g. 'prod_id')

should refer to "prefix", not "suffix", as in:

@Entity(name="prod") public class Product will result in a computed foreign key (for the @ElementCollection table) with the prefix 'prod' rather than 'Product' (e.g. 'prod_id')

I see this has already been made "VERIFIED" so didn't want to update the doc text itself.


Note You need to log in before you can comment on or make changes to this bug.