org.hibernate.hql.ast.QuerySyntaxException with Hibernate

后端 未结 7 1992
死守一世寂寞
死守一世寂寞 2021-02-20 01:34

I\'m new to using Hibernate with Java. I\'m getting the following exception. The stuff that I found online regarding this error didn\'t seem to help. Any ideas? The Exception:<

7条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-02-20 02:12

    I know it has been a long time on this matter, but none of the above answers solved my problem.

    I had already declared the entity in the persistence.xml file. At the end the whole problem was simply that the name of the entity is case sensitive on my system.

    This jpql was wrong

    SELECT u FROM user u WHERE userId = 1?

    But this one works fine

    SELECT u FROM User u WHERE userId = 1?

提交回复
热议问题