• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

'Simple' Hibernate query not returning any results.

 
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
Saloon Keeper
Posts: 15627
46
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
Pie
Posts: 20745
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to our ORM forum.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic