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 :
      http://www.hibernate.org/hib_docs/entitymanager/reference/en/html/queryhql.html
      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 :
      http://phpfi.com/265208

      Shouldnt it return null if no results were found ?