Package io.jmix.dataimport
Interface DuplicateEntityManager
- All Known Implementing Classes:
DuplicateEntityManagerImpl
public interface DuplicateEntityManager
Executes import for a given import configuration and
ImportedData
.-
Method Summary
Modifier and TypeMethodDescriptionSearches an entity in the specified list that has the same property values as in specified map.boolean
isDuplicated
(Object firstEntity, Object secondEntity, UniqueEntityConfiguration configuration) Checks whether specified entities are duplicates by properties from the givenUniqueEntityConfiguration
.Loads an entity by given property values.load
(Object entity, UniqueEntityConfiguration configuration, FetchPlan fetchPlan) Searches in the database the duplicate for a specified entity by properties from the givenUniqueEntityConfiguration
.
-
Method Details
-
load
Searches in the database the duplicate for a specified entity by properties from the givenUniqueEntityConfiguration
.- Parameters:
entity
- entity for which duplicated is searchedconfiguration
- unique entity configurationfetchPlan
- fetch plan with which the duplicate entity is loaded- Returns:
- found duplicate
-
isDuplicated
boolean isDuplicated(Object firstEntity, Object secondEntity, UniqueEntityConfiguration configuration) Checks whether specified entities are duplicates by properties from the givenUniqueEntityConfiguration
.- Parameters:
firstEntity
- first entitysecondEntity
- second entityconfiguration
- unique entity configuration- Returns:
- true if entities are duplicates
-
find
Searches an entity in the specified list that has the same property values as in specified map.- Parameters:
existingEntities
- entities to search the entity by property valuespropertyValues
- property values- Returns:
- found entity
-
load
@Nullable Object load(Class entityClass, Map<String, Object> propertyValues, @Nullable FetchPlan fetchPlan) Loads an entity by given property values.- Parameters:
entityClass
- class of entity to loadpropertyValues
- property valuesfetchPlan
- fetch plan- Returns:
- loaded entity
-