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

JOUFFRE Nelly (JIRA) noreply at atlassian.com
Thu Mar 31 10:07:12 EDT 2011


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-6039?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=41917#action_41917 ] 

JOUFFRE Nelly commented on HHH-6039:
------------------------------------

After some checking it looks like the PersistenceClass.jpaEntityName is not set when using Hibernate hbm.xml mapping because this property is set in EntityBinder.bindEntity() method which is only called by AnnotationBinder.

> jpaEntityName not set when using Hibernate mapping
> --------------------------------------------------
>
>                 Key: HHH-6039
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6039
>             Project: Hibernate Core
>          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
>         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.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list