Win a copy of Java 9 Revealed this week in the Features new in Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

NoResultException  RSS feed

 
Ismael Gimenez
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, im having trouble with the code listed below.



When i the system execute the code it returns null insted of throwing an exception.

I donno why.
 
Vijitha Kumara
Bartender
Posts: 3974
24
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you checked the generated query in this case? What id returns if executed directly against the DB?
 
Ismael Gimenez
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vijitha, thanks for the response.

A few days ago i realized that I was somehow wrong, since the query did find results. That is to say, it finds a result in the DB with the name pass as parameter and the query returns a property of that result that it turns out to be null.
Therefore, it finds a result that is null, that is different to not finding a result at all.

Anyway, thanks for your time!

Cheers!
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!