code: public List findByQuery(String query, Map<Parameter, Object> parameterMap, int firstResult, int maxResult)
      {
          s = getStatelessSession();
  
          Query q = s.createQuery(query);
          q.setFirstResult(firstResult);
          q.setMaxResults(maxResult);
  
          setParameters(parameterMap, q);
  
          return q.list();
      }
docs: Find.
  
  @param query
  the native fquery
  @param parameterMap
  the parameter map
  @param maxResult
  @param firstResult
  @return the list