Uploaded image for project: 'Hibernate ORM'
  1. HHH-8839

Eager Map with entity key causes IllegalStateException: Collection element (many-to-many) table alias cannot be empty

    Details

    • Bug Testcase Reminder (view):

      Bug reports should generally be accompanied by a test case!

    • Last commented by a user?:
      true

      Description

      I have a regression from WF 8 Beta 1, I created a small test case that demostrate it.
      In practice mapping an ElementCollection like this:
      @ElementCollection(fetch = FetchType.EAGER)
      @CollectionTable(name = "OUTPUTREQUEST_PREVWQUERYPRM")
      @MapKeyJoinColumn(name = "param_id", referencedColumnName = "id")
      Map<ParameterRegistry, String> previewQueryParams;
      I got an exception during deployment:
      Caused by: java.lang.IllegalStateException: Collection element (many-to-many) table alias cannot be empty
      at org.hibernate.loader.plan.exec.internal.LoadQueryJoinAndFetchProcessor.renderManyToManyJoin(LoadQueryJoinAndFetchProcessor.java:357) [hibernate-core-4.3.0.Final.jar:4.3.0.Final]
      at org.hibernate.loader.plan.exec.internal.LoadQueryJoinAndFetchProcessor.renderJoin(LoadQueryJoinAndFetchProcessor.java:154) [hibernate-core-4.3.0.Final.jar:4.3.0.Final]
      at org.hibernate.loader.plan.exec.internal.LoadQueryJoinAndFetchProcessor.processQuerySpaceJoin(LoadQueryJoinAndFetchProcessor.java:137) [hibernate-core-4.3.0.Final.jar:4.3.0.Final]
      at org.hibernate.loader.plan.exec.internal.LoadQueryJoinAndFetchProcessor.processQuerySpaceJoins(LoadQueryJoinAndFetchProcessor.java:132) [hibernate-core-4.3.0.Final.jar:4.3.0.Final]
      at org.hibernate.loader.plan.exec.internal.LoadQueryJoinAndFetchProcessor.processQuerySpaceJoin(LoadQueryJoinAndFetchProcessor.java:138) [hibernate-core-4.3.0.Final.jar:4.3.0.Final]
      at org.hibernate.loader.plan.exec.internal.LoadQueryJoinAndFetchProcessor.processQuerySpaceJoins(LoadQueryJoinAndFetchProcessor.java:132) [hibernate-core-4.3.0.Final.jar:4.3.0.Final]
      at org.hibernate.loader.plan.exec.internal.LoadQueryJoinAndFetchProcessor.processQuerySpaceJoins(LoadQueryJoinAndFetchProcessor.java:113) [hibernate-core-4.3.0.Final.jar:4.3.0.Final]
      at org.hibernate.loader.plan.exec.internal.AbstractLoadQueryDetails.generate(AbstractLoadQueryDetails.java:171) [hibernate-core-4.3.0.Final.jar:4.3.0.Final]
      at org.hibernate.loader.plan.exec.internal.EntityLoadQueryDetails.<init>(EntityLoadQueryDetails.java:106) [hibernate-core-4.3.0.Final.jar:4.3.0.Final]
      at org.hibernate.loader.plan.exec.internal.BatchingLoadQueryDetailsFactory.makeEntityLoadQueryDetails(BatchingLoadQueryDetailsFactory.java:73) [hibernate-core-4.3.0.Final.jar:4.3.0.Final]
      at org.hibernate.loader.entity.plan.AbstractLoadPlanBasedEntityLoader.<init>(AbstractLoadPlanBasedEntityLoader.java:100) [hibernate-core-4.3.0.Final.jar:4.3.0.Final]
      at org.hibernate.loader.entity.plan.EntityLoader.<init>(EntityLoader.java:134) [hibernate-core-4.3.0.Final.jar:4.3.0.Final]
      at org.hibernate.loader.entity.plan.EntityLoader.<init>(EntityLoader.java:55) [hibernate-core-4.3.0.Final.jar:4.3.0.Final]
      at org.hibernate.loader.entity.plan.EntityLoader$Builder.byUniqueKey(EntityLoader.java:98) [hibernate-core-4.3.0.Final.jar:4.3.0.Final]
      at org.hibernate.loader.entity.plan.EntityLoader$Builder.byPrimaryKey(EntityLoader.java:94) [hibernate-core-4.3.0.Final.jar:4.3.0.Final]
      at org.hibernate.loader.entity.plan.AbstractBatchingEntityLoaderBuilder.buildNonBatchingLoader(AbstractBatchingEntityLoaderBuilder.java:47) [hibernate-core-4.3.0.Final.jar:4.3.0.Final]
      at org.hibernate.loader.entity.BatchingEntityLoaderBuilder.buildLoader(BatchingEntityLoaderBuilder.java:76) [hibernate-core-4.3.0.Final.jar:4.3.0.Final]
      at org.hibernate.persister.entity.AbstractEntityPersister.createEntityLoader(AbstractEntityPersister.java:2506) [hibernate-core-4.3.0.Final.jar:4.3.0.Final]
      at org.hibernate.persister.entity.AbstractEntityPersister.createEntityLoader(AbstractEntityPersister.java:2528) [hibernate-core-4.3.0.Final.jar:4.3.0.Final]
      at org.hibernate.persister.entity.AbstractEntityPersister.createLoaders(AbstractEntityPersister.java:4029) [hibernate-core-4.3.0.Final.jar:4.3.0.Final]
      at org.hibernate.persister.entity.AbstractEntityPersister.postInstantiate(AbstractEntityPersister.java:4011) [hibernate-core-4.3.0.Final.jar:4.3.0.Final]
      at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:479) [hibernate-core-4.3.0.Final.jar:4.3.0.Final]
      at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1857) [hibernate-core-4.3.0.Final.jar:4.3.0.Final]
      at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:850) [hibernate-entitymanager-4.3.0.Final.jar:4.3.0.Final]
      at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl$4.perform(EntityManagerFactoryBuilderImpl.java:843) [hibernate-entitymanager-4.3.0.Final.jar:4.3.0.Final]
      at org.hibernate.boot.registry.classloading.internal.ClassLoaderServiceImpl.withTccl(ClassLoaderServiceImpl.java:399) [hibernate-core-4.3.0.Final.jar:4.3.0.Final]
      at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:842) [hibernate-entitymanager-4.3.0.Final.jar:4.3.0.Final]
      at org.jboss.as.jpa.hibernate4.TwoPhaseBootstrapImpl.build(TwoPhaseBootstrapImpl.java:44) [jipijapa-hibernate4-3-1.0.0.Final.jar:]
      at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1$1.run(PersistenceUnitServiceImpl.java:154) [wildfly-jpa-8.0.0.CR1.jar:8.0.0.CR1]
      ... 8 more
      I saw that is raised in the org.hibernate.loader.plan.exec.internal.LoadQueryJoinAndFetchProcessor.renderManyToOneJoin().
      The same test-case work under
      WF 8.0.0.Beta1
      Glassfish 4
      WebLogic 12c

        Attachments

          Activity

            People

            • Votes:
              20 Vote for this issue
              Watchers:
              22 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: