We have the below entity mapping in our project. It is working fine until hibernate version 4.3.8 but when i upgrade to 4.3.11, the test cases started failing with the below error. Entity mapping: --------------------------- @Entity @Table(name = "EMPLOYEE") public class Employee { @Id @Column(name = "EMPLOYEE_ID") private long id; @OneToMany(mappedBy="owner", cascade = CascadeType.ALL, fetch = FetchType.EAGER) @MapKey(name = "phoneType") private Map<PhoneType, Phone> phones = new HashMap<PhoneType, Phone>() ... } @Entity @Table(name = "PHONE") public class Phone { @Id @ManyToOne @JoinColumn(name = "EMPLOYEE_ID", referencedColumnName = "EMPLOYEE_ID") @NotNull private Employee owner; @Id @ManyToOne @JoinColumn(name = "PHONE_TYPE_ID", nullable = false) @NotNull @Fetch(FetchMode.SELECT) private PhoneType phoneType; @NotNull @Column(name = "PHONE_NUMBER") private String phoneNumber; ... } @Entity @Table(name = "PHONE_TYPE") public class PhoneType { @Id @Column(name = "PHONE_TYPE_ID") private long id; @NotNull @Column(name = "PHONE_TYPE") private String phoneType; ... } --------------------------- Exception Cause: Caused by: java.lang.IllegalStateException: Could not locate collection index join within collection join [<gen:2> : OneToManyPersister(com.xyz.Employee.phones)] at org.hibernate.loader.plan.exec.internal.LoadQueryJoinAndFetchProcessor.renderCollectionJoin(LoadQueryJoinAndFetchProcessor.java:353) at org.hibernate.loader.plan.exec.internal.LoadQueryJoinAndFetchProcessor.renderJoin(LoadQueryJoinAndFetchProcessor.java:163) at org.hibernate.loader.plan.exec.internal.LoadQueryJoinAndFetchProcessor.processQuerySpaceJoin(LoadQueryJoinAndFetchProcessor.java:138) at org.hibernate.loader.plan.exec.internal.LoadQueryJoinAndFetchProcessor.processQuerySpaceJoins(LoadQueryJoinAndFetchProcessor.java:133) at org.hibernate.loader.plan.exec.internal.LoadQueryJoinAndFetchProcessor.processQuerySpaceJoins(LoadQueryJoinAndFetchProcessor.java:114) at org.hibernate.loader.plan.exec.internal.AbstractLoadQueryDetails.generate(AbstractLoadQueryDetails.java:171) at org.hibernate.loader.plan.exec.internal.EntityLoadQueryDetails.<init>(EntityLoadQueryDetails.java:107) at org.hibernate.loader.plan.exec.internal.BatchingLoadQueryDetailsFactory.makeEntityLoadQueryDetails(BatchingLoadQueryDetailsFactory.java:73) at org.hibernate.loader.entity.plan.AbstractLoadPlanBasedEntityLoader.<init>(AbstractLoadPlanBasedEntityLoader.java:100) at org.hibernate.loader.entity.plan.EntityLoader.<init>(EntityLoader.java:134) at org.hibernate.loader.entity.plan.EntityLoader.<init>(EntityLoader.java:55) at org.hibernate.loader.entity.plan.EntityLoader$Builder.byUniqueKey(EntityLoader.java:98) at org.hibernate.loader.entity.plan.EntityLoader$Builder.byPrimaryKey(EntityLoader.java:94) at org.hibernate.loader.entity.plan.AbstractBatchingEntityLoaderBuilder.buildNonBatchingLoader(AbstractBatchingEntityLoaderBuilder.java:47) at org.hibernate.loader.entity.BatchingEntityLoaderBuilder.buildLoader(BatchingEntityLoaderBuilder.java:76) at org.hibernate.persister.entity.AbstractEntityPersister.createEntityLoader(AbstractEntityPersister.java:2506) at org.hibernate.persister.entity.AbstractEntityPersister.createEntityLoader(AbstractEntityPersister.java:2528) at org.hibernate.persister.entity.AbstractEntityPersister.createLoaders(AbstractEntityPersister.java:4035) at org.hibernate.persister.entity.AbstractEntityPersister.postInstantiate(AbstractEntityPersister.java:4017) at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:481) at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1859) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:857) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:850) at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.withTccl(ClassLoaderServiceImpl.java:425) at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:849) at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:60) at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:343) at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:318) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1627) at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1564) ... 44 more SKIPPED CONFIGURATION: @BeforeMethod springTestContextBeforeTestMethod SKIPPED: testPhone |