Can't use annotations to map nested Embeddables where the inner instance has a ManyToOne reference

Description

Using annotations, we set up an Entity containing an ElementCollection, whose elements themselves contain an Embeddable, which has a ManyToOne reference to another Entity. When we use this set up to build the SessionFactory, it fails with an ArrayIndexOutOfBoundsException in the AbstractCollectionPersister.

Exception is below, source code files are attached: Run View.main() to reproduce the issue.

{{Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 1
at org.hibernate.persister.collection.AbstractCollectionPersister.initCollectionPropertyMap(AbstractCollectionPersister.java:1736)
at org.hibernate.persister.collection.AbstractCollectionPersister.initCollectionPropertyMap(AbstractCollectionPersister.java:1712)
at org.hibernate.persister.collection.AbstractCollectionPersister.<init>(AbstractCollectionPersister.java:600)
at org.hibernate.persister.collection.BasicCollectionPersister.<init>(BasicCollectionPersister.java:74)
at org.hibernate.persister.PersisterFactory.createCollectionPersister(PersisterFactory.java:104)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:318)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1385)
at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:954)
at com.rtrms.hibernate.View.main(View.java:46)}}

Environment

Hibernate 3.5.5, any database.

Activity

Show:
ChrisL
March 7, 2012, 4:47 PM

I just tried this in 4.1.0, and it still breaks with the same underlying exception.

Brett Meyer
April 7, 2014, 5:43 PM

In an effort to clean up, in bulk, tickets that are most likely out of date, we're transitioning all ORM 3 tickets to an "Awaiting Test Case" state. Please see http://in.relation.to/Bloggers/HibernateORMJIRAPoliciesAndCleanUpTactics for more information.

If this is still a legitimate bug in ORM 4, please provide either a test case that reproduces it or enough detail (entities, mappings, snippets, etc.) to show that it still fails on 4. If nothing is received within 3 months or so, we'll be automatically closing them.

Thank you!

Brett Meyer
July 8, 2014, 3:11 PM

Bulk rejecting stale issues. If this is still a legitimate issue on ORM 4, feel free to comment and attach a test case. I'll address responses case-by-case. Thanks!

Rejected

Assignee

Unassigned

Reporter

ChrisL

Fix versions

None

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

Priority

Major
Configure