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