[hibernate-issues] [Hibernate-JIRA] Resolved: (HHH-6039) jpaEntityName not set when using Hibernate mapping

Gail Badner (JIRA) noreply at atlassian.com
Tue Jan 24 18:19:10 EST 2012


     [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-6039?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gail Badner resolved HHH-6039.
------------------------------

    Resolution: Duplicate
      Assignee: Gail Badner

> jpaEntityName not set when using Hibernate mapping
> --------------------------------------------------
>
>                 Key: HHH-6039
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6039
>             Project: Hibernate ORM
>          Issue Type: Bug
>          Components: metamodel, query-criteria
>    Affects Versions: 3.6.2
>         Environment: hibernate-(core, entitymanager...)-3.6.2.Final
> hibernate-jpa-2.0-api-1.0.0.Final
> MySQL 5.1
> Spring 3.0.5.RELEASE
>            Reporter: JOUFFRE Nelly
>            Assignee: Gail Badner
>         Attachments: Qualifier.hbm.xml
>
>
> I'm trying to run the following query
> CriteriaBuilder cb = entityManager.getCriteriaBuilder();
> CriteriaQuery<Qualifier> cq = cb.createQuery(Qualifier.class);
> Root<Qualifier> qualifRoot = cq.from(Qualifier.class);
> List<Qualifier> results = entityManager.createQuery(cq).getResultList();
> The Qualifier class is mapped using Hibernate hbm.xml mapping (see attachement)
> The entityManagerFactory is configured using a Spring class
> <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
> ...
> </bean>
> This Criteria query throws the exception: org.hibernate.hql.ast.QuerySyntaxException: unexpected token: null near line 1, column 29 [select generatedAlias0 from null as generatedAlias0]
> The FROM clause, which here is null, is built using the EntityType.jpaEntityName property which value comes from PersistentClass.jpaEntityName property. But this property is never set when context is loaded to build the Metamodel.
> Is this property not set because the mapping is an hibernate mapping and not a JPA one ? or is it a bug ?

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list