Class EntityPropertiesPopulatorImpl
java.lang.Object
io.jmix.dataimport.property.populator.impl.EntityPropertiesPopulatorImpl
- All Implemented Interfaces:
EntityPropertiesPopulator
@Component("datimp_EntityPropertiesPopulator")
public class EntityPropertiesPopulatorImpl
extends Object
implements EntityPropertiesPopulator
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
addCreatedReference
(Object entity, List<CreatedReference> createdReferences, ReferenceMultiFieldPropertyMapping propertyMapping) protected void
fillCreatedReferences
(Object entity, ReferenceMultiFieldPropertyMapping referenceMultiFieldPropertyMapping, List<CreatedReference> createdReferences) protected List<CreatedReference>
getCreatedReferences
(Object entity, ImportConfiguration configuration) protected CreatedReference
getCreatedReferences
(Object entityToPopulate, Object referenceValue, ReferenceMultiFieldPropertyMapping propertyMapping) populateProperties
(Object entity, ImportConfiguration importConfiguration, ImportedDataItem dataItem) Populates the entity properties for which mappings are set in the import configuration by values.populateProperties
(Object entity, ImportConfiguration importConfiguration, ImportedDataItem dataItem, Map<PropertyMapping, List<Object>> createdReferences) Populates the entity properties for which mappings are set in the import configuration by values.protected void
populateProperty
(Object entity, PropertyMapping propertyMapping, ImportConfiguration importConfiguration, RawValuesSource rawValuesSource, Map<PropertyMapping, List<Object>> createdReferences) populateReference
(Object entity, ReferenceMultiFieldPropertyMapping referenceMapping, ImportConfiguration importConfiguration, RawValuesSource rawValuesSource) Populates the reference entity properties for which mappings are set in the reference mapping by values.
-
Field Details
-
entityStates
-
propertyValueProvider
-
-
Constructor Details
-
EntityPropertiesPopulatorImpl
public EntityPropertiesPopulatorImpl()
-
-
Method Details
-
populateProperties
public EntityInfo populateProperties(Object entity, ImportConfiguration importConfiguration, ImportedDataItem dataItem) Description copied from interface:EntityPropertiesPopulator
Populates the entity properties for which mappings are set in the import configuration by values.- Specified by:
populateProperties
in interfaceEntityPropertiesPopulator
- Parameters:
entity
- entity which properties are populated by valuesimportConfiguration
- import configurationdataItem
- source of raw values of properties- Returns:
- object that contains entity populated by property values and info about created references
-
populateProperties
public EntityInfo populateProperties(Object entity, ImportConfiguration importConfiguration, ImportedDataItem dataItem, @Nullable Map<PropertyMapping, List<Object>> createdReferences) Description copied from interface:EntityPropertiesPopulator
Populates the entity properties for which mappings are set in the import configuration by values. For import policies that require loading of existing reference: Many-to-one reference is created if an existing entity does not exist in the database and is not presented in the created references.- Specified by:
populateProperties
in interfaceEntityPropertiesPopulator
- Parameters:
entity
- entity which properties are populated by valuesimportConfiguration
- import configurationdataItem
- source of raw values of propertiescreatedReferences
- map that contains already created reference entity by property mappings- Returns:
- object that contains entity populated by property values and info about created references
-
populateProperty
protected void populateProperty(Object entity, PropertyMapping propertyMapping, ImportConfiguration importConfiguration, RawValuesSource rawValuesSource, @Nullable Map<PropertyMapping, List<Object>> createdReferences) -
populateReference
public Object populateReference(Object entity, ReferenceMultiFieldPropertyMapping referenceMapping, ImportConfiguration importConfiguration, RawValuesSource rawValuesSource) Description copied from interface:EntityPropertiesPopulator
Populates the reference entity properties for which mappings are set in the reference mapping by values.- Specified by:
populateReference
in interfaceEntityPropertiesPopulator
- Parameters:
entity
- reference entity which properties are populated by valuesreferenceMapping
- reference mappingimportConfiguration
- import configurationrawValuesSource
- source of raw values of properties- Returns:
- reference entity with populated by property values
-
getCreatedReferences
protected List<CreatedReference> getCreatedReferences(Object entity, ImportConfiguration configuration) -
fillCreatedReferences
protected void fillCreatedReferences(Object entity, ReferenceMultiFieldPropertyMapping referenceMultiFieldPropertyMapping, List<CreatedReference> createdReferences) -
addCreatedReference
protected void addCreatedReference(Object entity, List<CreatedReference> createdReferences, ReferenceMultiFieldPropertyMapping propertyMapping) -
getCreatedReferences
protected CreatedReference getCreatedReferences(Object entityToPopulate, Object referenceValue, ReferenceMultiFieldPropertyMapping propertyMapping)
-