Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Hibernate query returning 0 records

 
Gene Golovchinsky
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an application that uses hibernate to get data from a MySQL database. I've enabled hibernate logging, and can see the query that is being generated. When I copy that query into the MySQL Query Browser and plug in the same values as are passed to my code, I get a bunch of records (867); when the code runs, however, it returns 0 records. The same code works with other data values. Any idea how to debug this?

Thanks,

Gene
 
Gene Golovchinsky
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Looks like the problem was that I wasn't querying with the data that the system was actually using because of a logic flaw. Glad I caught it now!

Gene
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic