Code example for SQLQuery

Methods: setFirstResult

0
    { 
        if (firstResultIndex < maxResultIndex)
        { 
            // TODO:namedquery, JPQL, HQL => iterate, native => then don't 
 
            result = sqlQuery.setFirstResult(firstResultIndex++).setMaxResults(1).list();
        } 
 
        return result != null && !result.isEmpty() && fetchSize != 0;
    } 
 
    @Override 
    public E next() 
    { 
        if (result == null || result.isEmpty() || fetchSize == 0)
        { 
            throw new NoSuchElementException("Nothing to scroll further for: " + m.getEntityClazz());
        } 
 
        fetchSize--;