You might want to do two things.
1. Post if you are getting any exceptions.
2. Turn-on hibernate.show_sql=true in the configuration document and see what query it is running.
This will show you the SQL query which hibernate uses to fetch data.
If you are not laughing at yourself, then you just didn't get the joke.
posted 5 years ago
Wrap your query execution code with in a transaction and it should work.
session.getTransaction().begin(); and session.getTransaction().commit();
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads