Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

'Simple' Hibernate query not returning any results.  RSS feed

 
Kevin P Smith
Ranch Hand
Posts: 362
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I was just wondering if someone could help me with what is no doubt an obvious error in my code below...

I have the folling piece of code, which when I change the HQL to "FROM Customer" does return a list of all customers in the table customer.
But when I include the 'WHERE' clause, and pass over a usernbame & password that does exist, the return List is empty.
The column names for usename and password are correct (password column is 'pwd') and as I say, the username and password used do exist in the table, because if I run
"SELECT * FROM customer WHERE username = 'username1' AND pwd = 'password1' " I get a returned row.
So there must be something wrong with this piece of code, but I can't see it.
As I say, it's probably pretty obvious to someone who knows.



Thanks in advance.
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 16028
87
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What exactly is hibernateManagementService and how is it setting the arguments and doing the query?
 
Rob Spoor
Sheriff
Posts: 21092
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to our ORM forum.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!