TypedQueryImpl extends AbstractQuery implements TypedQuery<X> { @Override public TypedQuery<X> setMaxResults(int maxResults) { ensureOpen(); checkNumericParameter(maxResults, "max results"); query.setMaxResults(maxResults); return this; } TypedQueryImpl(final QueryHolder query, final Class<X> resultType,
                          final ConnectionWrapper connection, MetamodelProvider metamodelProvider); void setUnitOfWork(UnitOfWork uow); @Override List<X> getResultList(); @Override X getSingleResult(); @Override Stream<X> getResultStream(); @Override TypedQuery<X> setMaxResults(int maxResults); @Override TypedQuery<X> setFirstResult(int startPosition); @Override TypedQuery<X> setParameter(int position, Object value); @Override TypedQuery<X> setParameter(int position, String value, String language); @Override TypedQuery<X> setParameter(String name, Object value); @Override TypedQuery<X> setParameter(String name, String value, String language); @Override TypedQuery<X> setParameter(Parameter<T> parameter, T value); @Override TypedQuery<X> setParameter(Parameter<String> parameter, String value, String language); @Override TypedQuery<X> setUntypedParameter(int position, Object value); @Override TypedQuery<X> setUntypedParameter(String name, Object value); @Override TypedQuery<X> setUntypedParameter(Parameter<T> parameter, T value); @Override TypedQuery<X> setDescriptor(Descriptor descriptor);  }
@Test void exceptionInSetMaxResultsInvokesRollbackMarker() { final TypedQueryImpl<OWLClassA> q = queryWithRollbackMarker(SELECT_QUERY, OWLClassA.class); try { q.setMaxResults(-1); } catch (RuntimeException e) { } verify(handler).execute(); }