public abstract class AEntityImportConfig<T extends de.xima.cmn.dao.interfaces.IEntity<Long>> extends Object implements IEntityImportConfig<T>
Modifier and Type | Field and Description |
---|---|
protected de.xima.cmn.dao.interfaces.IEntity<Long> |
context |
protected Set<IEntityDependency> |
dependencies |
protected T |
entity |
protected String |
importJson |
protected static org.slf4j.Logger |
LOG |
protected static String |
LOG_PREFIX |
protected Long |
originalID |
protected String |
originalName |
protected UUID |
originalUUID |
protected T |
persisted |
protected String |
persistedName |
Constructor and Description |
---|
AEntityImportConfig(IEntityContext ec,
de.xima.cmn.dao.interfaces.IEntity<Long> context,
T entity,
Set<IEntityDependency> dependencies,
String importJson) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
compareTo
protected static final org.slf4j.Logger LOG
protected static final String LOG_PREFIX
protected String persistedName
protected Set<IEntityDependency> dependencies
protected String importJson
protected Long originalID
protected UUID originalUUID
protected String originalName
protected de.xima.cmn.dao.interfaces.IEntity<Long> context
public AEntityImportConfig(IEntityContext ec, de.xima.cmn.dao.interfaces.IEntity<Long> context, T entity, Set<IEntityDependency> dependencies, String importJson)
@Deprecated public void setEntity(T entity)
setEntity
in interface IEntityImportConfig<T extends de.xima.cmn.dao.interfaces.IEntity<Long>>
entity
- T
that should be importedpublic T getEntity()
getEntity
in interface IEntityImportConfig<T extends de.xima.cmn.dao.interfaces.IEntity<Long>>
T
that should be importedpublic T getPersisted()
getPersisted
in interface IEntityImportConfig<T extends de.xima.cmn.dao.interfaces.IEntity<Long>>
T
persisted entity that may be overriddenpublic void setPersisted(T persisted)
setPersisted
in interface IEntityImportConfig<T extends de.xima.cmn.dao.interfaces.IEntity<Long>>
public Class<?> getEntityClass()
getEntityClass
in interface IEntityImportConfig<T extends de.xima.cmn.dao.interfaces.IEntity<Long>>
public Set<IEntityDependency> getDependencies()
getDependencies
in interface IEntityImportConfig<T extends de.xima.cmn.dao.interfaces.IEntity<Long>>
List
of all the dependencies to this entitypublic EEntityConflictResolveAction getConflictResolveAction()
getConflictResolveAction
in interface IEntityImportConfig<T extends de.xima.cmn.dao.interfaces.IEntity<Long>>
EEntityConflictResolveAction
specifying what to do if the entity already existspublic void setConflictResolveAction(EEntityConflictResolveAction conflictResolveAction)
setConflictResolveAction
in interface IEntityImportConfig<T extends de.xima.cmn.dao.interfaces.IEntity<Long>>
conflictResolveAction
- EEntityConflictResolveAction
specifying what to do if the entity already
existspublic boolean isEntityExists()
isEntityExists
in interface IEntityImportConfig<T extends de.xima.cmn.dao.interfaces.IEntity<Long>>
true
if the given entity already exists (based on UUID and its context)public boolean isImported()
isImported
in interface IEntityImportConfig<T extends de.xima.cmn.dao.interfaces.IEntity<Long>>
public void setImported(boolean imported)
IEntityImportConfig
true
if the entity has been importedsetImported
in interface IEntityImportConfig<T extends de.xima.cmn.dao.interfaces.IEntity<Long>>
public String getImportJson()
getImportJson
in interface IEntityImportConfig<T extends de.xima.cmn.dao.interfaces.IEntity<Long>>
public Long getOriginalID()
getOriginalID
in interface IEntityImportConfig<T extends de.xima.cmn.dao.interfaces.IEntity<Long>>
public UUID getOriginalUUID()
getOriginalUUID
in interface IEntityImportConfig<T extends de.xima.cmn.dao.interfaces.IEntity<Long>>
null
if the entity is no IUUIDEntity
public String getOriginalName()
getOriginalName
in interface IEntityImportConfig<T extends de.xima.cmn.dao.interfaces.IEntity<Long>>
public List<IEntityImportConfig<?>> getChildren()
getChildren
in interface IEntityImportConfig<T extends de.xima.cmn.dao.interfaces.IEntity<Long>>
public List<IEntityImportConfig<?>> getAllChildrenFlat()
getAllChildrenFlat
in interface IEntityImportConfig<T extends de.xima.cmn.dao.interfaces.IEntity<Long>>
public void setAlternativeId(Long alternativeId)
setAlternativeId
in interface IEntityImportConfig<T extends de.xima.cmn.dao.interfaces.IEntity<Long>>
alternativeId
- of an existing entity of type T
that should be used insteadpublic T loadAlternative(IEntityContext ec)
loadAlternative
in interface IEntityImportConfig<T extends de.xima.cmn.dao.interfaces.IEntity<Long>>
ec
- IEntityContext
to useT
entity that should be used insteadpublic void updatePersisted(IEntityContext ec)
IEntityImportConfig
updatePersisted
in interface IEntityImportConfig<T extends de.xima.cmn.dao.interfaces.IEntity<Long>>
ec
- IEntityContext
to be used for updating the persisted entitypublic void stage(IEntityContext ec) throws Exception
IEntityImportConfig
stage
in interface IEntityImportConfig<T extends de.xima.cmn.dao.interfaces.IEntity<Long>>
ec
- IEntityContext
to be usedException
public List<DependencyDescriptor> finalize(IEntityContext ec, String fcVersion, String exportVersion) throws Exception
IEntityImportConfig
finalize
in interface IEntityImportConfig<T extends de.xima.cmn.dao.interfaces.IEntity<Long>>
ec
- IEntityContext
to be usedList
of DependencyDescriptor
s of missing dependenciesException
@Deprecated public void resolveDependencies(IEntityContext ec)
IEntityImportConfig
resolveDependencies
in interface IEntityImportConfig<T extends de.xima.cmn.dao.interfaces.IEntity<Long>>
ec
- IEntityContext
to be usedprotected boolean isUuidExisting(IEntityContext ec)
protected abstract void makeEntityUnique(IEntityContext ec) throws Exception
Exception
protected void preCreate(IEntityContext ec) throws Exception
Exception
protected void preUpdate(IEntityContext ec) throws Exception
Exception
protected void postCreate(IEntityContext ec) throws Exception
Exception
protected void postUpdate(IEntityContext ec) throws Exception
Exception
protected void validateImport(IEntityContext ec) throws Exception
Exception
protected static UUID getDependencyUuid(IEntityImportConfig<?> config, String fieldDescriptor)
protected static String getUuidEntityValue(com.google.gson.JsonObject authConfig, String key)
protected T findPersisted(IEntityContext ec)
@Deprecated public de.xima.cmn.dao.interfaces.IEntity<Long> getEntityToOverride()
getEntityToOverride
in interface IEntityImportConfig<T extends de.xima.cmn.dao.interfaces.IEntity<Long>>
IEntity
that should be overridden instead of the persisted@Deprecated public void setEntityToOverride(de.xima.cmn.dao.interfaces.IEntity<Long> entityToOverride)
setEntityToOverride
in interface IEntityImportConfig<T extends de.xima.cmn.dao.interfaces.IEntity<Long>>
entityToOverride
- IEntity
that should be overridden instead of the persistedCopyright © 2021 XIMA MEDIA GmbH. All rights reserved.