Interface IEntityImportConfig<T extends de.xima.cmn.dao.interfaces.IEntity<Long>>

    • Method Detail

      • setEntity

        void setEntity​(T entity)
        Parameters:
        entity - IEntityImportConfig that should be imported
      • getPersisted

        T getPersisted()
        Returns:
        IEntityImportConfig persisted entity that may be overridden
      • setPersisted

        void setPersisted​(T entity)
      • getEntityClass

        Class<?> getEntityClass()
        Returns:
        the class of the entity
      • getUnresolvedDependencies

        Map<de.xima.cmn.dao.interfaces.IEntity<Long>,​List<IEntityDependency>> getUnresolvedDependencies()
        Returns:
        a map of all the entities of this import config that have unresolved dependencies. This includes not only entity dependencies of this import configs entity but also dependencies of its children, e.g.: a ProjectImportConfig might have unresolved dependencies for one of its WorkflowStates.
      • isEntityExists

        boolean isEntityExists()
        Returns:
        true if the given entity already exists (based on UUID and its context)
      • isImported

        boolean isImported()
        Returns:
        whether or not the entity has been imported yet
      • getOriginalID

        Long getOriginalID()
        Returns:
        original ID of the entity
      • getOriginalUUID

        UUID getOriginalUUID()
        Returns:
        original UUID of the entity or null if the entity is no IUUIDEntity
      • getOriginalExportId

        Long getOriginalExportId()
        Returns:
        The original ID of the entity from the export file. Note that getOriginalID() may be null when the IDs are not preserved, this will always be set to the original ID from the export file.
      • getOriginalName

        String getOriginalName()
        Returns:
        original name of the entity before import (and possible name change)
      • getAllChildrenFlat

        List<IEntityImportConfig<?>> getAllChildrenFlat()
        Returns:
        all child importConfigs. Including the children of children
      • updatePersisted

        void updatePersisted​(IEntityContext ec)
        Updates the persisted entity if existing based on the entity represented by this config
        Parameters:
        ec - IEntityContext to be used for updating the persisted entity
      • setAlternativeId

        void setAlternativeId​(Long alternativeId)
        Parameters:
        alternativeId - of an existing entity of type IEntityImportConfig that should be used instead
      • finalize

        List<DependencyDescriptor> finalize​(IEntityContext ec,
                                            String fcVersion,
                                            String exportVersion)
                                     throws Exception
        Finish the import. Should be called after every import config has been staged for import and deprecated fields have been handled.
        Parameters:
        ec - IEntityContext to be used
        fcVersion - The current FORMCYCLE version where the entity is imported.
        exportVersion - The FORMCYCLE version that was used to create the export file with the entity.
        Returns:
        List of DependencyDescriptors of missing dependencies
        Throws:
        Exception
      • getEntityToOverride

        @Deprecated
        de.xima.cmn.dao.interfaces.IEntity<Long> getEntityToOverride()
        Deprecated.
        Returns:
        IEntity that should be overridden instead of the persisted
      • setEntityToOverride

        @Deprecated
        void setEntityToOverride​(de.xima.cmn.dao.interfaces.IEntity<Long> entityToOverride)
        Deprecated.
        Parameters:
        entityToOverride - IEntity that should be overridden instead of the persisted
      • setImported

        @Deprecated
        void setImported​(boolean imported)
        Deprecated.
        Set to true if the entity has been imported
      • getImportJson

        @Deprecated
        String getImportJson()
        Deprecated.
        Returns:
        the original JSON String of the import entity