JPA supports several types of queries - named JPQL, named native/SQL,
dynamic JPQL, and dynamic native/SQL.  It appears that you are trying
create a dynamic query using the named query API method.  A named
query is specified in the domain object and is created using the query
name.  (ex.  em.createNamedQuery("Room.detailSearch")).  If you want
to use dynamic JPQL you need to use the em.createQuery method.  (ex.
em.createQuery("select r from Room r  where r.price >= ?1 and
r.maxPeople >= ?2").  Otherwise, OpenJPA will look for a query named
"select r..." and will not find it - which is the problem you are
experiencing.

Aside, if you want to use your named "Room.detailSearch" query be sure
to specify a valid JPQL query - "select r from Room r ..."

-Jeremy

Reply via email to