Class PagingJpaQueryIterable<T,R>
java.lang.Object
org.axonframework.common.legacyjpa.PagingJpaQueryIterable<T,R>
- Type Parameters:
T- The query result type.R- The mapped result type.
- All Implemented Interfaces:
Iterable<R>
Deprecated.
Enables iterating through a JPA query using paging while lazily mapping the results when necessary. Paging is taken
care of automatically, fetching the next page when the items run out to iterate through.
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.
The iterator() function can be called multiple times to loop through the items, restarting the query from
the start.
- Since:
- 4.6.0
- Author:
- Mitchell Herrijgers
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassDeprecated.TheIteratorthat loops through the provided query's pages until it runs out of items. -
Constructor Summary
ConstructorsConstructorDescriptionPagingJpaQueryIterable(int pageSize, TransactionManager transactionManager, Supplier<javax.persistence.TypedQuery<T>> querySupplier, Function<T, R> lazyMappingFunction) Deprecated.Constructs a newIterableusing the providedquerySupplierto construct queries when a new page needs to be fetched. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
PagingJpaQueryIterable
public PagingJpaQueryIterable(int pageSize, TransactionManager transactionManager, Supplier<javax.persistence.TypedQuery<T>> querySupplier, Function<T, R> lazyMappingFunction) Deprecated.Constructs a newIterableusing the providedquerySupplierto construct queries when a new page needs to be fetched. Items are lazily mapped by the providedlazyMappingFunctionwhen iterating.- Parameters:
pageSize- The size of the pages.transactionManager- TheTransactionManagerto 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.
-
-
Method Details
PagingJpaQueryIterablewhich moved to jakarta.