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

JOUFFRE Nelly (JIRA) noreply at atlassian.com
Tue Jan 24 11:35:09 EST 2012


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

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

Hi Scott,

Thank you for fixing this. 
Actually you should have added 3 lines, because in HbmBinder there is 2 places where you have to fix the setting of declaredIdentifierProperty (in bindSimpleId method and also in bindCompositeId method unless theses methods have changed since my bug report)
Anyway, I suppose you can also close this bug which is related to the same problem
https://hibernate.onjira.com/browse/HHH-6100?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=44252#comment-44252
Will this bug fix be included in the next version of hibernate-core ?








> 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
>         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