T- The query result type.
R- The mapped result type.
Do not use this for paging when you care about concurrent deletes. If you loaded a page, delete an item from it, and load the next, you will miss an item during iteration.
iterator() function can be called multiple times to loop through the items, restarting the query from
|Modifier and Type||Class and Description|
|Constructor and Description|
Constructs a new
|Modifier and Type||Method and Description|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
public PagingJpaQueryIterable(int pageSize, TransactionManager transactionManager, Supplier<jakarta.persistence.TypedQuery<T>> querySupplier, Function<T,R> lazyMappingFunction)
Iterableusing the provided
querySupplierto construct queries when a new page needs to be fetched. Items are lazily mapped by the provided
pageSize- The size of the pages.
TransactionManagerto use when fetching items.
querySupplier- The supplier of the queries. Will be invoked for each page.
lazyMappingFunction- The mapping function to map items to the desired representation.
Copyright © 2010–2023. All rights reserved.