Interface IdMapper

  • All Known Implementing Classes:
    AbstractIdMapper, SiteRestoreIdMapper, SpaceRestoreIdMapper

    public interface IdMapper
    Responsible for keeping all required id mappings between the old ids and the new ones. Also provides information about records saved to the database.
    Since:
    7.20.0
    • Method Detail

      • getDatabaseId

        Object getDatabaseId​(Class<?> clazz,
                             Object xmlId)
        Returns the database id related to the xml id or null if the database id was not generated before.
      • prepareObjectsToBePersisted

        Collection<ImportedObjectV2> prepareObjectsToBePersisted​(ExportableEntityInfo entityInfo,
                                                                 Collection<ImportedObjectV2> importedObjects)
        Prepares records to be inserted to the database. During space restore it will replace all ids with new one.
        Parameters:
        entityInfo - entity info of persisted objects
        importedObjects - Objects that should be persisted
        Returns:
        Returns objects which are ready to be persisted
      • isPersistedXmlId

        boolean isPersistedXmlId​(Class<?> clazz,
                                 Object xmlId)
        Check if the records with id from XML has been persisted.
      • markObjectsAsPersisted

        void markObjectsAsPersisted​(ExportableEntityInfo entityInfo,
                                    List<Object> databaseObjectIds)
        Marks all ids as persisted. This method is usually called when the transaction is committed.
        Parameters:
        entityInfo - entity info
        databaseObjectIds - database objects ids