org.hibernate.hql.internal.ast.QuerySyntaxException: table is not mapped

后端 未结 19 1726
滥情空心
滥情空心 2020-12-04 14:59

I have example web application Hibernate 4.3.5 + Derby database 10.10.1.1+ Glassfish4.0 with IDE NetBeans 8.0Beta.

I have the next exception:

Caused          


        
19条回答
  •  天命终不由人
    2020-12-04 15:30

    Should use Entity class name for em.createQuery method or Should use em.createNativeQuery method for native query without entity class

    With Entity class:

    em.createQuery("select first_name from CUSTOMERV")

    Without Entity class or Native query:

    em.createNativeQuery("select c.first_name from CUSTOMERV c")

提交回复
热议问题