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

后端 未结 19 1719
滥情空心
滥情空心 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:38

    Finally I found a mistake! Hope this is useful to someone. When doing a request to the database(in my case it Apache Derby), name of base need write the first letter upper case other in lower case.

    This is wrong query:

    session.createQuery("select first_name from CUSTOMERV").
    

    This is valid query

    session.createQuery("select first_name from Customerv"). 
    

    And class entity must be same name as database, but I'm not sure.

提交回复
热议问题