The QueryBuilder is not a static class, you must construct a new QueryBuilder instance for each query you produce.
Use the setUnbounded(boolean unbounded) and setMaxHits(long maxHits) methods to specify the number of hits your generated query should return.