Bug 1265256 - [GSS](6.4.z) HHH-5764 - AssertionFailure: Unexpected nested component on the referenced entity when mapping a @MapsId
Summary: [GSS](6.4.z) HHH-5764 - AssertionFailure: Unexpected nested component on the ...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Hibernate
Version: 6.4.4
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: CR1
: EAP 6.4.6
Assignee: Gail Badner
QA Contact: Martin Simka
URL:
Whiteboard:
Depends On:
Blocks: 1235746 1286824
TreeView+ depends on / blocked
 
Reported: 2015-09-22 13:25 UTC by Gary Hu
Modified: 2019-10-10 10:13 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-01-17 11:49:02 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
hibernate4.01491237.HHH-5764.tar.gz (38.74 KB, application/x-gzip)
2015-09-22 13:25 UTC, Gary Hu
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Red Hat Knowledge Base (Solution) 2143451 0 None None None 2016-01-28 14:54:57 UTC

Description Gary Hu 2015-09-22 13:25:12 UTC
Created attachment 1075834 [details]
hibernate4.01491237.HHH-5764.tar.gz

When the composite primary key references more than 2 levels, it fails with the error "org.hibernate.AssertionFailure: Unexpected nested component on the referenced entity when mapping a @MapsId: xxx".

For example:
@Entity
@IdClass(Level1EntityPK.class)
public class Level1Entity {

    @Id
    @ManyToOne
    private Level2Entity level2Entity;
    ...
}

@Entity
@IdClass(Level2EntityPK.class)
public class Level2Entity {
    @Id
    @ManyToOne
    private Level3Entity level3Entity;
    
    ...
}

@Entity
@IdClass(Level3EntityPK.class)
public class Level3Entity {

    @Id
    @Column(name = "LEVEL3_ENTITY_NO")
    private String level3EntityNo;
   
    ...
}

A jira https://hibernate.atlassian.net/browse/HHH-5764 has already been raised.

Comment 1 Gary Hu 2015-09-22 13:28:41 UTC
I have attached a simple test project that could reproduce the issue.

To run the test project:

1) edit the src/test/resources/META-INF/persistence.xml to use your own database connection properties(url, username, password, etc.)

2) type mvn clean package

Comment 3 Gail Badner 2015-10-29 23:05:00 UTC
Final touches are being made to upstream pull request. This should make it into EAP 6.4.6 if approved.

Comment 6 Jan Martiska 2016-01-20 08:37:51 UTC
Verified with EAP 6.4.6.CR2

Comment 7 Petr Penicka 2017-01-17 11:49:02 UTC
Retroactively bulk-closing issues from released EAP 6.4 cumulative patches.


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