Class KeysetAllEntitiesLoader
java.lang.Object
io.jmix.gridexportflowui.exporter.entitiesloader.AbstractAllEntitiesLoader
io.jmix.gridexportflowui.exporter.entitiesloader.KeysetAllEntitiesLoader
- All Implemented Interfaces:
AllEntitiesLoader
This loader implements the keyset pagination strategy. Entities retrieval is based on sorting
by primary key. The next page starts after the last entity on the previous page.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.jmix.gridexportflowui.exporter.entitiesloader.AllEntitiesLoader
AllEntitiesLoader.ExportedEntityVisitor
-
Field Summary
Fields inherited from class io.jmix.gridexportflowui.exporter.entitiesloader.AbstractAllEntitiesLoader
dataManager, gridExportProperties, metadataTools, platformTransactionManager
-
Constructor Summary
ConstructorDescriptionKeysetAllEntitiesLoader
(MetadataTools metadataTools, DataManager dataManager, org.springframework.transaction.PlatformTransactionManager platformTransactionManager, GridExportProperties gridExportProperties) -
Method Summary
Modifier and TypeMethodDescriptionprotected LoadContext
generateLoadContext
(CollectionLoader loader) Type of data loading strategy defined as string constant.protected void
loadEntities
(CollectionLoader<?> collectionLoader, AllEntitiesLoader.ExportedEntityVisitor exportedEntityVisitor, int loadBatchSize) Sort entities by the primary key, load the first batch and save the last entity primary key value.Methods inherited from class io.jmix.gridexportflowui.exporter.entitiesloader.AbstractAllEntitiesLoader
getDataLoader, getValueLoadContextQuery, loadAll, loadKeyValueEntities
-
Field Details
-
PAGINATION_STRATEGY
- See Also:
-
LAST_LOADED_PK_CONDITION_PARAMETER_NAME
-
-
Constructor Details
-
KeysetAllEntitiesLoader
public KeysetAllEntitiesLoader(MetadataTools metadataTools, DataManager dataManager, org.springframework.transaction.PlatformTransactionManager platformTransactionManager, GridExportProperties gridExportProperties)
-
-
Method Details
-
getPaginationStrategy
Description copied from interface:AllEntitiesLoader
Type of data loading strategy defined as string constant.AllEntitiesLoaderFactory.getEntitiesLoader()
returns loader which pagination strategy equals toGridExportProperties.getExportAllPaginationStrategy()
-
generateLoadContext
- Specified by:
generateLoadContext
in classAbstractAllEntitiesLoader
-
loadEntities
protected void loadEntities(CollectionLoader<?> collectionLoader, AllEntitiesLoader.ExportedEntityVisitor exportedEntityVisitor, int loadBatchSize) Sort entities by the primary key, load the first batch and save the last entity primary key value. Load the next batch with primary keys after the last entity primary key.- Specified by:
loadEntities
in classAbstractAllEntitiesLoader
- Parameters:
exportedEntityVisitor
-AllEntitiesLoader.ExportedEntityVisitor.visitEntity(EntityExportContext)
loadBatchSize
-GridExportProperties.getExportAllBatchSize()
number of entities loaded in one query
-