Just from my database experience I would say that it is not possible. Any sane 
JPA-Provider will execute the query using a PreparedStatement and any sane JDBC 
driver will excute a prepared statement using bind variables.

AFAIK bind variables can only represent SQL literals like strings, numbers and 
dates but they can not be replaced by a database object like a column.

So your named query would result in something


  | SELECT * FROM TBL_HOT_CONTENT ORDER BY 'viewsWeekly desc'
  | 

and this will not work for obvious reasons. Please correct me if I am wrong.

Regards

Felix

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4008590#4008590

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4008590
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to