@Override
    public T next() {
        if (hasNext()) {
            next = null;
            try {
                return produceNext(rs);
            } catch (SQLException e) {
                close();
                throw configuration.translate(e);
            } catch (Exception e) {
                close();
                throw new QueryException(e);
            }
        } else {
            throw new NoSuchElementException();
        }
    }
{@code SQLResultIterator} is an Iterator adapter for JDBC result sets with customizable projections

@author tiwe

@param <T>
querydsl-sql/src/main/java/com/querydsl/sql/SQLResultIterator.java