Package io.jmix.dataimport.impl
Class DuplicateEntityManagerImpl
java.lang.Object
io.jmix.dataimport.impl.DuplicateEntityManagerImpl
- All Implemented Interfaces:
DuplicateEntityManager
@Component("datimp_DuplicateEntityManager")
public class DuplicateEntityManagerImpl
extends Object
implements DuplicateEntityManager
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionSearches an entity in the specified list that has the same property values as in specified map.protected boolean
findNotEqualValue
(Object firstEntity, Object secondEntity, UniqueEntityConfiguration uniqueEntityConfiguration) protected boolean
findNotEqualValue
(Map<String, Object> propertyValues, Object entity) 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
.protected Object
loadByCondition
(Class entityClass, FetchPlan fetchPlan, LogicalCondition condition)
-
Field Details
-
dataManager
-
-
Constructor Details
-
DuplicateEntityManagerImpl
public DuplicateEntityManagerImpl()
-
-
Method Details
-
load
Description copied from interface:DuplicateEntityManager
Searches in the database the duplicate for a specified entity by properties from the givenUniqueEntityConfiguration
.- Specified by:
load
in interfaceDuplicateEntityManager
- Parameters:
entity
- entity for which duplicated is searchedconfiguration
- unique entity configurationfetchPlan
- fetch plan with which the duplicate entity is loaded- Returns:
- found duplicate
-
isDuplicated
public boolean isDuplicated(Object firstEntity, Object secondEntity, UniqueEntityConfiguration configuration) Description copied from interface:DuplicateEntityManager
Checks whether specified entities are duplicates by properties from the givenUniqueEntityConfiguration
.- Specified by:
isDuplicated
in interfaceDuplicateEntityManager
- Parameters:
firstEntity
- first entitysecondEntity
- second entityconfiguration
- unique entity configuration- Returns:
- true if entities are duplicates
-
findNotEqualValue
protected boolean findNotEqualValue(Object firstEntity, Object secondEntity, UniqueEntityConfiguration uniqueEntityConfiguration) -
loadByCondition
@Nullable protected Object loadByCondition(Class entityClass, @Nullable FetchPlan fetchPlan, LogicalCondition condition) -
find
Description copied from interface:DuplicateEntityManager
Searches an entity in the specified list that has the same property values as in specified map.- Specified by:
find
in interfaceDuplicateEntityManager
- Parameters:
existingEntities
- entities to search the entity by property valuespropertyValues
- property values- Returns:
- found entity
-
findNotEqualValue
-
load
public Object load(Class entityClass, Map<String, Object> propertyValues, @Nullable FetchPlan fetchPlan) Description copied from interface:DuplicateEntityManager
Loads an entity by given property values.- Specified by:
load
in interfaceDuplicateEntityManager
- Parameters:
entityClass
- class of entity to loadpropertyValues
- property valuesfetchPlan
- fetch plan- Returns:
- loaded entity
-