private void applyRowSelection(QueryParameters queryParameters, Query query) { RowSelection rowSelection = queryParameters.getRowSelection(); if ( rowSelection == null ) { return; } Integer firstRow = rowSelection.getFirstRow(); Integer maxRows = rowSelection.getMaxRows(); if ( firstRow != null ) { query.startOffset( firstRow ); } if ( maxRows != null ) { query.maxResults( maxRows ); } } }