TypedQueryImpl extends AbstractQuery implements TypedQuery<X> { @Override public TypedQuery<X> setParameter(int position, Object value) { super.setParameter(position, value); 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 exceptionInSetParameterByPositionInvokesRollbackMarker() { final TypedQueryImpl<OWLClassA> q = queryWithRollbackMarker(SELECT_QUERY, OWLClassA.class); try { q.setParameter(117, 117); } catch (RuntimeException e) { } verify(handler).execute(); }
@Test void exceptionInSetStringParameterByPositionInvokesRollbackMarker() { final TypedQueryImpl<OWLClassA> q = queryWithRollbackMarker(SELECT_QUERY, OWLClassA.class); try { q.setParameter(117, "A", "en"); } catch (RuntimeException e) { } verify(handler).execute(); }
@Test void exceptionInSetParameterByNameInvokesRollbackMarker() { final TypedQueryImpl<OWLClassA> q = queryWithRollbackMarker(SELECT_QUERY, OWLClassA.class); try { q.setParameter("a", 117); } catch (RuntimeException e) { } verify(handler).execute(); }
@Test void exceptionInSetStringParameterByNameInvokesRollbackMarker() { final TypedQueryImpl<OWLClassA> q = queryWithRollbackMarker(SELECT_QUERY, OWLClassA.class); try { q.setParameter("a", "A", "en"); } catch (RuntimeException e) { } verify(handler).execute(); }
@Test void exceptionInSetParameterByParameterInvokesRollbackMarker() { final TypedQueryImpl<OWLClassA> q = queryWithRollbackMarker(SELECT_QUERY, OWLClassA.class); try { q.setParameter(new QueryParameter<>(117, mock(ParameterValueFactory.class)), 117); } catch (RuntimeException e) { } verify(handler).execute(); }
@Test void exceptionInSetStringParameterByParameterInvokesRollbackMarker() { final TypedQueryImpl<OWLClassA> q = queryWithRollbackMarker(SELECT_QUERY, OWLClassA.class); try { q.setParameter(new QueryParameter<>(117, mock(ParameterValueFactory.class)), "A", "en"); } catch (RuntimeException e) { } verify(handler).execute(); }