Win a copy of Machine Learning Systems: Designs that scale this week in the Scala forum
or Xamarin in Action: Creating native cross-platform mobile apps in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

book is not mapped - hibernate issue  RSS feed

 
Greenhorn
Posts: 3
Hibernate PHP Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

      I am trying to create CRUD for Book Entity. But getting this error.:



HTTP Status 500 - Request processing failed; nested exception is java.lang.IllegalArgumentException: org.hibernate.hql.internal.ast.QuerySyntaxException: book is not mapped [from book].

Here the code :







servlet config file.





 
Sheriff
Posts: 9611
37
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think you should be using the class name in the query not table name. Try this:
 
Ranch Hand
Posts: 196
1
Java jQuery Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Ankit Garg wrote:I think you should be using the class name in the query not table name. Try this:



I agree Ankit. For HQL Queries.  For HQL queries we use class name.
 
And then we all jump out and yell "surprise! we got you this tiny ad!"
free 1 hour java lesson
https://coderanch.com/t/695988/free-hour-java-lesson
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!