• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Error related to Hibernate Query

 
Varun Nambuthiri
Ranch Hand
Posts: 76
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

This is the error that the stacktrace displays every time i try to execute the query


the code where this error pops up




What does the error indicate ?

 
rohit chavan
Ranch Hand
Posts: 132
Hibernate Java Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Query q = session.createQuery("from user where username= :user and password =:pass");
You need to write the entire query that you can actually execute.
You should have usedin the above line.
 
Varun Nambuthiri
Ranch Hand
Posts: 76
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

I did try that too . Same kind of error occurred . Will make the changes and post the updated stackTrace .

Thanks and Regards
Varun
 
Bill Gorder
Bartender
Posts: 1682
7
Android IntelliJ IDE Linux Mac OS X Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First of all you are dealing with classes (case sensitive) is it really 'user' and not 'User'?

If that is not the problem then what kind of hibernate properties do you have set? Are things defined correctly in your cfg file?

Lastly try fully qualifying it (this should not be necessary but may be if your configurations are not correct)


*this assumes your class is user and not User
 
Varun Nambuthiri
Ranch Hand
Posts: 76
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey ,

Thanks Bill and Rohit , I have managed to solve it thanks to your advice Bill . I was using the table name in the DB (user) and not the class name (which was User) in the query .

so the query should have been

I will say this one more , This place is the best !! Thank you guys .Hope one day i will have learnt enough to start giving back to Ranch ..

Thank you
Regards
Varun
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic