[jboss-user] [EJB 3.0] - Re: Using a parameter as order by column

Wolfgang Knauf do-not-reply at jboss.com
Wed Mar 7 11:36:10 EST 2007


Hi Jürgen,

that's not possible. You cannot use parameters to control ordering. 
There are same posts in this forum regarding this problem, but there were no "brilliant" solutions. 
In your case (you don't use named queries), you could simply add the order by column to your query:


 Query query = em.createQuery("select d from Domaindata AS d ORDER BY " + orderByColumn);

Hope this helps

Wolfgang

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

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4025860




More information about the jboss-user mailing list