Querydsl - paging functionality
<p>It seems that in Jpa QueryDsl I can use paging like:</p>

<pre><code>return new JPAQueryFactory(getEntityManager())
    .selectFrom(entity)
    .where(where_clause)
    .orderBy(order_by_clause)
    .offset(pageNumber * 20)
    .limit(20)
    .fetchResults();
</code></pre>

<p>Questions are:</p>

<ul>
<li>Is it optimal approach? Does fetchResults load only 20 elements from DB and make count query to get information about total number of entities which are in db?</li>
<li>Or maybe there is some option like .page(2).limit(20)?</li>
</ul>

<p><em>Yes I know that Spring-Data has already Paging and interface for QueryDsl but because of the complicated "order by" clause which is not supported by Spring-Data I cannot use it :(</em></p>