readthefuckingmanual.net

[SOLVED] javax.persistence.NoResultException: No entity found for query

Error added: 2008-06-10T12:12:28Z

1 people waiting for the answer...

5 answers found.

Answer 839 (75.0% helpful)

Handle the exceptipon with try catch and eat the exception.
Permalink

Answer 608 (71.42857% helpful)

This is correct.

From http://www.hibernate.org/hib_docs/ejb3-api/javax/persistence/Query.html#getSingleResult%28%29

getSingleResult()

    Execute a SELECT query that returns a single result.

    Returns:
        the result 
    Throws:
        NoResultException - if there is no result 
        NonUniqueResultException - if more than one result 
        IllegalStateException - if called for a Java Persistence query language UPDATE or DELETE statement
Permalink

Answer 1487 (57.142857% helpful)

Throws NoResultException 
Permalink

Answer 1676 (50.0% helpful)

Use jdbc instead hibernate/jpa
Permalink

Answer 975 (0.0% helpful)

good
Permalink

Add an answer/solution

If you know the answer, please add your own solution below.
If you don't know, but find out later, please come back and share your answer - there will be other people struggling with this too.


Please enter 61948 here

If you want to be notified via email when this is solved, enter your email address here: