Thursday, February 14, 2008

Glad to see this works

I wasn't sure this would work. One quick unit test verifies that it does. Very good to know:

Query query = getEntityManager().createQuery("from User order by ?");
query.setParameter(1, "lastName");


I don't know why it wouldn't work, really, but I had only used replaceable parameters in the WHERE clause of queries before.

No comments: