Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JPA /Hibernate mapping error

 
jeff mutonho
Ranch Hand
Posts: 271
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to persist a simple User object to an HSQLDB.The code performs a check to see if the User already exist and if not , then persists the User object.
The code is shown below :



The User class looks like :


and my persistence.xml :




When I try to run the application , I'm getting the following exception:

 
jeff mutonho
Ranch Hand
Posts: 271
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Apologies for the double post.That wasn't intentional.Have already mailed Paul to remove the other post
 
Mr. C Lamont Gilbert
Ranch Hand
Posts: 1170
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there a table named USEERS in your database?
 
jeff mutonho
Ranch Hand
Posts: 271
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I realized where I was going wrong.In the query language , it's not the name of the table that one specifies , but rather the name of the class mapped to the table , hence in my case it was suppose to be :

The table name is specified as the object type , in this case User , not USERS(which is the table name)
 
Anoop K Thomas
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
jeff mutonho wrote:I realized where I was going wrong.In the query language , it's not the name of the table that one specifies , but rather the name of the class mapped to the table , hence in my case it was suppose to be :

The table name is specified as the object type , in this case User , not USERS(which is the table name)



Thanks dude, i also encountered the same problem and you saved the day for me
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic