1 Reply Latest reply on Sep 26, 2007 9:13 AM by Pete Muir

    EJB-QL - simple query problem :/

    Jacek Zebrowski Newbie

      As i read in documentation I'm allowed to use EL in queries.
      So supported with this article :
      i produced the following piece of code

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

      AFAiK the query itself should be correct. But at runtime i get the following exeption :

      Shouldnt it return null if no results were found ?