2 Replies Latest reply on Sep 28, 2007 10:37 AM by Jacek Zebrowski

    Noob query problem :/ simple select clause.

    Jacek Zebrowski Newbie

      Im using Seam in general but this one is about EJB-QL only i think...

      i have a following query :

      User existing = (User) em.createQuery("SELECT OBJECT(u) FROM User u WHERE u.login=#{newUser.login} AND u.passwdHash=#{newUser.passwdHash}").getSingleResult();

      and i constantly get such Exception :
      Exception during request processing:
      Caused by javax.servlet.ServletException with message: "#{userManager.register}: javax.ejb.EJBTransactionRolledbackException: No entity found for query"

      As far as i know if query returns no results it should return null ... so how to deal with it ?