[jboss-user] [EJB 3.0] - Re: @NamedQuery and setting orderBy as a parameter?

fhh do-not-reply at jboss.com
Wed Jan 31 15:25:10 EST 2007


anonymous wrote : 
  | Basically, this is a huge use-case for ejb3 and I'm suprised its not addressed, nor even discussed. Yet its the first thing anyone mentions when they get into implementing some ejb3 app. 
  | 

Why is this a huge use case? Simply do something like this:

  | public final String findHottestQuery = "select c FROM Content c"
  | 
  | Query q = em.createNamedQuery(findHottestContent + " order by viewsWeekly desc"); 
  | 

If your queries access different database objects (and not just different data) you will not profit from named queries or parametrized statements anyway.

Regards

Felix

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

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



More information about the jboss-user mailing list