Class KeysetAllEntitiesLoader
java.lang.Object
io.jmix.gridexportui.exporter.entitiesloader.AbstractAllEntitiesLoader
io.jmix.gridexportui.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.gridexportui.exporter.entitiesloader.AllEntitiesLoader
AllEntitiesLoader.ExportedEntityVisitor
-
Field Summary
Fields inherited from class io.jmix.gridexportui.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
(DataUnit dataUnit, Sort sort) Generates the load context using the givenDataUnit
.Type of data loading strategy defined as string constant.void
loadAll
(DataUnit dataUnit, AllEntitiesLoader.ExportedEntityVisitor exportedEntityVisitor, Sort sort) Method loads all entity instances associated with the givendataUnit
and pass each loaded entity instance to theexportedEntityVisitor
.
-
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
Generates the load context using the givenDataUnit
.- Specified by:
generateLoadContext
in classAbstractAllEntitiesLoader
- Parameters:
dataUnit
- data unit linked with the datasort
- An optional sorting specification for the data. Ifnull
sorting will be applied by the primary key.
-
loadAll
public void loadAll(DataUnit dataUnit, AllEntitiesLoader.ExportedEntityVisitor exportedEntityVisitor, @Nullable Sort sort) Method loads all entity instances associated with the givendataUnit
and pass each loaded entity instance to theexportedEntityVisitor
. Creation of the output file row is the responsibility of that visitor. Data is loaded in batches, the batch size is configured by theGridExportProperties.getExportAllBatchSize()
.- Parameters:
dataUnit
- data unit linked with the dataexportedEntityVisitor
- function that is responsible for exportsort
- An optional sorting specification for the data. Ifnull
sorting will be applied by the primary key.
-