This week's book giveaway is in the Java 9 forum.
We're giving away four copies of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications and have Sander Mak & Paul Bakker on-line!
See this thread for details.
Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the 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: 4001
42
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!
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!