Hello How do I catch a NoResultException after calling the getSingleResult() on a custom query, wich often doesn't return any result. Catching the NoResultException still logs an error (NoResultException: No entity found for query) and after that the Info is printed out. Happens both in the designer and on the server.
haven't tested yet with other Exceptions like NonUniqueResultException. Thank you in advance
This question is marked "community wiki".
asked 25.11.2014 at 16:35 Alexis |
If you are not sure if there is a single result available or if more than one result is available use the method getResultList() instead of getSingleResult(). Then check if the returning List is empty or contains more than one entry. answered 26.11.2014 at 09:19 Reto Weiss ♦♦ |
Once you sign in you will be able to subscribe for any updates here
By RSS:Markdown Basics
Tags:
Asked: 25.11.2014 at 16:35
Seen: 1,888 times
Last updated: 26.11.2014 at 09:19