Class AbstractAllEntitiesLoader
java.lang.Object
io.jmix.gridexportflowui.exporter.entitiesloader.AbstractAllEntitiesLoader
- All Implemented Interfaces:
AllEntitiesLoader
- Direct Known Subclasses:
KeysetAllEntitiesLoader,LimitOffsetAllEntitiesLoader
@NullMarked
public abstract class AbstractAllEntitiesLoader
extends Object
implements AllEntitiesLoader
Base class for the all entities loader which is used to export to other data formats such as excel or json
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.jmix.gridexportflowui.exporter.entitiesloader.AllEntitiesLoader
AllEntitiesLoader.ExportedEntityVisitor -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DataManagerprotected GridExportPropertiesprotected MetadataToolsprotected org.springframework.transaction.PlatformTransactionManager -
Constructor Summary
ConstructorsConstructorDescriptionAbstractAllEntitiesLoader(MetadataTools metadataTools, DataManager dataManager, org.springframework.transaction.PlatformTransactionManager platformTransactionManager, GridExportProperties gridExportProperties) -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract LoadContextgenerateLoadContext(CollectionLoader loader) protected @Nullable DataLoadergetDataLoader(DataUnit dataUnit) protected ValueLoadContext.QuerygetValueLoadContextQuery(ValueLoadContext valueLoadContext) voidloadAll(DataUnit dataUnit, AllEntitiesLoader.ExportedEntityVisitor exportedEntityVisitor) Deprecated, for removal: This API element is subject to removal in a future version.voidloadAll(DataUnit dataUnit, AllEntitiesLoader.ExportedEntityVisitor exportedEntityVisitor, int loadBatchSize) Loads entities in batches of the given size and exports each entity using theAllEntitiesLoader.ExportedEntityVisitor.protected abstract voidloadEntities(CollectionLoader<?> collectionLoader, AllEntitiesLoader.ExportedEntityVisitor exportedEntityVisitor, int loadBatchSize) protected voidloadKeyValueEntities(KeyValueCollectionLoader loader, AllEntitiesLoader.ExportedEntityVisitor exportedEntityVisitor, int loadBatchSize) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.jmix.gridexportflowui.exporter.entitiesloader.AllEntitiesLoader
getPaginationStrategy
-
Field Details
-
metadataTools
-
dataManager
-
platformTransactionManager
protected org.springframework.transaction.PlatformTransactionManager platformTransactionManager -
gridExportProperties
-
-
Constructor Details
-
AbstractAllEntitiesLoader
public AbstractAllEntitiesLoader(MetadataTools metadataTools, DataManager dataManager, org.springframework.transaction.PlatformTransactionManager platformTransactionManager, GridExportProperties gridExportProperties)
-
-
Method Details
-
loadAll
@Deprecated(since="3.1", forRemoval=true) public void loadAll(DataUnit dataUnit, AllEntitiesLoader.ExportedEntityVisitor exportedEntityVisitor) Deprecated, for removal: This API element is subject to removal in a future version.useloadAll(DataUnit, ExportedEntityVisitor, int)insteadLoads all entity instances associated with the givendataUnitand calls theentityExporterto export each loaded entity instance. Creation of the output file object is the responsibility ofentityExporter. Data is loaded in batches, the batch size is configured by theGridExportProperties.getExportAllBatchSize().- Specified by:
loadAllin interfaceAllEntitiesLoader- Parameters:
dataUnit- data unit linked with the dataexportedEntityVisitor- visitor which exports entity to appropriate format
-
loadAll
public void loadAll(DataUnit dataUnit, AllEntitiesLoader.ExportedEntityVisitor exportedEntityVisitor, int loadBatchSize) Description copied from interface:AllEntitiesLoaderLoads entities in batches of the given size and exports each entity using theAllEntitiesLoader.ExportedEntityVisitor. A loader whose data source has no notion of batches may ignore the batch size.The default implementation exists only for loaders written before the batch size was introduced: it ignores
loadBatchSizeand delegates toAllEntitiesLoader.loadAll(DataUnit, ExportedEntityVisitor). Override it.- Specified by:
loadAllin interfaceAllEntitiesLoader- Parameters:
dataUnit- data unit linked with the dataexportedEntityVisitor- visitor which exports entity to appropriate formatloadBatchSize- number of entities loaded in one query, positive
-
generateLoadContext
-
loadEntities
protected abstract void loadEntities(CollectionLoader<?> collectionLoader, AllEntitiesLoader.ExportedEntityVisitor exportedEntityVisitor, int loadBatchSize) -
getDataLoader
-
loadKeyValueEntities
protected void loadKeyValueEntities(KeyValueCollectionLoader loader, AllEntitiesLoader.ExportedEntityVisitor exportedEntityVisitor, int loadBatchSize) -
getValueLoadContextQuery
-
loadAll(DataUnit, ExportedEntityVisitor, int)instead