Forums Register Login

Error related to Hibernate Query

+Pie Number of slices to send: Send
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 ?

+Pie Number of slices to send: Send
 

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.
+Pie Number of slices to send: Send
Hi ,

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

Thanks and Regards
Varun
+Pie Number of slices to send: Send
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
+Pie Number of slices to send: Send
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
It's just a flesh wound! Or a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 3036 times.
Similar Threads
connection, pool exhausted ???
Named no know - Hibernate
. java.lang.IllegalArgumentException: callable not yet supported for native queries
File Upload not working as expected with javascript,ajax, struts
Class Cast Exception
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 04:02:53.