Hibernate table not mapped error in HQL query

后端 未结 9 762
轮回少年
轮回少年 2020-11-27 13:47

I have a web application that use Hibernate to make CRUD operations over a database. I got an error saying that the table is not mapped. See the Java files:

Error me

9条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-27 14:09

    Thanks everybody. Lots of good ideas. This is my first application in Spring and Hibernate.. so a little more patience when dealing with "novices" like me..

    Please read Tom Anderson and Roman C.'s answers. They explained very well the problem. And all of you helped me.I replaced

    SELECT COUNT(*) FROM Books
    

    with

    select count(book.id) from Book book
    

    And of course, I have this Spring config:

    
    
    

    Thank you all again!

提交回复
热议问题