Eclipse Community Forums - RDF feed
https://www.eclipse.org/forums/
Eclipse Community ForumsNamed Query not found
https://www.eclipse.org/forums/index.php/mv/msg/369976/903502/#msg_903502
((JpaEntityManager)em.getDelegate()).getSession().getQueries()
and the count is 0, there should be two named queries defined.]]>Miguel Missing name2012-08-24T01:45:37-00:00Re: Named Query not found
https://www.eclipse.org/forums/index.php/mv/msg/369976/904480/#msg_904480
Chris Delahunt2012-08-28T13:55:11-00:00Re: Named Query not found
https://www.eclipse.org/forums/index.php/mv/msg/369976/905003/#msg_905003
It is possible to use a sessions.xml generated by the EclipseLink Mapping Workbench, but this is more for backward compatibility for users migrating from the EclipseLink native ORM.
For the native ORM named queries are defined on the descriptor (per class), but for JPA they need to be defined on the Session, this may be why your query is not found.
There is a persistence unit property you can set to copy all of the descriptor queries to the session (you must ensure they have unique names).