[jboss-user] [EJB 3.0] - JbossQL and m.createQuery(.. OFFSET 5 LIMIT 23)

cjc do-not-reply at jboss.com
Fri Aug 25 04:33:28 EDT 2006


Hello,
I need to Query with LIMIT the Reslult length.  I found 11.6.4. JBossQL in the documentation, but I do not like to write a jbosscmp-jdbc.xml file. Is there a way to make it like below, the Query must also be dynamic because of Order :

  | @PersistenceContext
  | Entitymanager manager;
  | 
  | public List<SomeObj> findAllBlub(Integer offset, Integer limit){
  |   String order = "ORDER BY ....."
  |   return manager.createQuery("SELECT o FROM SomeObj o "+ order +" OFFSET "+ offset +" LIMIT "+ limit).getResultList();
  | }
  | 

I'm using Jboss4.0.4 GA .

thx for Help
cjc

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

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



More information about the jboss-user mailing list