Package io.jmix.dataimport.impl
Class DataImportExecutor
java.lang.Object
io.jmix.dataimport.impl.DataImportExecutor
@Component("datimp_DataImportExecutor")
@Scope("prototype")
public class DataImportExecutor
extends Object
Executes import for a given import configuration and
ImportedData
.-
Field Summary
Modifier and TypeFieldDescriptionprotected DuplicateEntityManager
protected EntityExtractor
protected EntityImportExport
protected EntityImportPlans
protected EntityPropertiesPopulator
protected EntityStates
protected FetchPlans
protected ImportConfiguration
protected ImportedData
protected ImportResult
protected static final org.slf4j.Logger
protected Metadata
protected MetadataTools
-
Constructor Summary
ConstructorDescriptionDataImportExecutor
(ImportConfiguration importConfiguration, ImportedData importedData) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
addReferencePropertyToImportPlan
(EntityImportPlanBuilder ownerBuilder, String propertyName, MetaProperty property, EntityImportPlan propertyImportPlan) protected void
applyEntityInitializer
(List<Object> entitiesToImport) protected boolean
checkEntityDuplicate
(EntityExtractionResult extractionResult) protected boolean
checkEntityDuplicate
(EntityExtractionResult entityExtractionResult, List<EntityExtractionResult> processedResults) protected boolean
checkExtractedEntity
(EntityExtractionResult entityExtractionResult) checkExtractionResults
(List<EntityExtractionResult> extractionResults) protected boolean
checkPreImportPredicate
(EntityExtractionResult entityExtractionResult) protected EntityImportError
createEntityImportErrorResult
(EntityExtractionResult result, String errorMessage, EntityImportErrorType entityImportErrorType) protected EntityImportPlan
createEntityImportPlan
(Object entityToImport) protected EntityImportPlanBuilder
createEntityImportPlanBuilder
(MetaClass ownerEntityMetaClass, List<PropertyMapping> propertyMappings, Object ownerEntity) protected EntityImportPlanBuilder
createEntityImportPlanForCollection
(MetaProperty property, ReferenceMultiFieldPropertyMapping referenceMapping) protected void
createErrorResult
(Exception e, String errorMessage) protected Object
getDuplicateEntity
(Object extractedEntity, UniqueEntityConfiguration configuration, List<EntityExtractionResult> processedResults) protected FetchPlanBuilder
protected void
importEntities
(List<Object> entitiesToImport) protected void
importEntity
(EntityExtractionResult entityExtractionResult) protected void
protected void
protected void
processBatch
(List<ImportedDataItem> importedDataItemsBatch) protected boolean
processExistingEntity
(EntityExtractionResult extractionResult, UniqueEntityConfiguration configuration, Object existingEntity)
-
Field Details
-
log
protected static final org.slf4j.Logger log -
metadata
-
metadataTools
-
entityImportPlans
-
entityStates
-
entityImportExport
-
duplicateEntityManager
-
fetchPlans
-
entityPropertiesPopulator
-
entityExtractor
-
importResult
-
importConfiguration
-
importedData
-
-
Constructor Details
-
DataImportExecutor
-
-
Method Details
-
importData
-
importInOneTransaction
protected void importInOneTransaction() -
importByBatches
protected void importByBatches() -
processBatch
-
importInMultipleTransactions
protected void importInMultipleTransactions() -
checkExtractionResults
-
checkExtractedEntity
-
checkEntityDuplicate
-
processExistingEntity
protected boolean processExistingEntity(EntityExtractionResult extractionResult, UniqueEntityConfiguration configuration, Object existingEntity) -
checkEntityDuplicate
protected boolean checkEntityDuplicate(EntityExtractionResult entityExtractionResult, List<EntityExtractionResult> processedResults) -
getDuplicateEntity
@Nullable protected Object getDuplicateEntity(Object extractedEntity, UniqueEntityConfiguration configuration, @Nullable List<EntityExtractionResult> processedResults) -
checkPreImportPredicate
-
applyEntityInitializer
-
importEntity
-
importEntities
-
createEntityImportErrorResult
protected EntityImportError createEntityImportErrorResult(EntityExtractionResult result, String errorMessage, EntityImportErrorType entityImportErrorType) -
createErrorResult
-
getFetchPlanBuilder
-
createEntityImportPlan
-
createEntityImportPlanBuilder
protected EntityImportPlanBuilder createEntityImportPlanBuilder(MetaClass ownerEntityMetaClass, List<PropertyMapping> propertyMappings, Object ownerEntity) -
createEntityImportPlanForCollection
protected EntityImportPlanBuilder createEntityImportPlanForCollection(MetaProperty property, ReferenceMultiFieldPropertyMapping referenceMapping) -
addReferencePropertyToImportPlan
protected void addReferencePropertyToImportPlan(EntityImportPlanBuilder ownerBuilder, String propertyName, MetaProperty property, EntityImportPlan propertyImportPlan)
-