Let's say I have tones of named queries through all my entities. These queries have one/two or more named parameters in conditional expression.
The common way to encapsulate my named query lookup in my JPADAO is something like this:
Query q = %getEntityManager()%.createNamedQuery( %queryName% );
q.setParameter ("someParam", new Date ());
q.setParameter ("anotherParam", true);