Alok Agrawal wrote:I am not able to find any solution on that. It seems to me that for every search criteria, I have to write new named Query.
Any suggestion or pointers will be appreciated.
A named query for every search criteria is overkill.
Basically you are trying to append the column name to the existing where in the plain sql.
You may want to look into dynamic queries using EntityManager. Have a look
here to check out how dynamic queries compare to named queries.