2 Replies Latest reply on May 24, 2005 5:23 AM by jameswoodward

    Use OFFSET and LIMIT in NamedQuery?

    jameswoodward Newbie

      Is it possible to use the OFFSET and LIMIT commands in a NamedQuery.

      I've tried using:

      @NamedQuery(name="File.findManyByCompanyId", queryString="SELECT f FROM File f WHERE f.companyId = :companyId OFFSET :offset LIMIT :limit")

      Here is the equivalent EJB 2.1 query, that I would like to reproduce:

      SELECT OBJECT(f) FROM File f WHERE f.companyId = ?1 OFFSET ?2 LIMIT ?3