users@glassfish.java.net

Re: How do I manuplate the named query at run time?

From: <glassfish_at_javadesktop.org>
Date: Tue, 15 May 2007 15:10:55 PDT

Hi Rahul,

named queries can not be modified a runtime. If you know about all the different scenarios at development time, you could provide a different named query for all situations. The best way might be to switch to dynamic queries. Dynamic queries can be constructed using either JP-QL or native SQL using either the EnittyManager's createQuery(String qlString) or createNativeQuery(String sqlString) method.
[Message sent by forum member 'mf125085' (mf125085)]

http://forums.java.net/jive/thread.jspa?messageID=217216