Package org.springframework.data.jpa.repository.query.JpaQueryExecution

Examples of org.springframework.data.jpa.repository.query.JpaQueryExecution.PagedExecution


    } else if (method.isCollectionQuery()) {
      return new CollectionExecution();
    } else if (method.isSliceQuery()) {
      return new SlicedExecution(method.getParameters());
    } else if (method.isPageQuery()) {
      return new PagedExecution(method.getParameters());
    } else if (method.isModifyingQuery()) {
      return method.getClearAutomatically() ? new ModifyingExecution(method, em) : new ModifyingExecution(method, null);
    } else {
      return new SingleEntityExecution();
    }
View Full Code Here


    Parameters<?, ?> parameters = new DefaultParameters(getClass().getMethod("sampleMethod", Pageable.class));
    when(jpaQuery.createCountQuery(Mockito.any(Object[].class))).thenReturn(countQuery);
    when(jpaQuery.createQuery(Mockito.any(Object[].class))).thenReturn(query);
    when(countQuery.getResultList()).thenReturn(Arrays.asList(20L));

    PagedExecution execution = new PagedExecution(parameters);
    execution.doExecute(jpaQuery, new Object[] { new PageRequest(2, 10) });

    verify(query, times(0)).getResultList();
  }
View Full Code Here

TOP

Related Classes of org.springframework.data.jpa.repository.query.JpaQueryExecution.PagedExecution

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.