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.
    • 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.
        entityInfo - entity info of persisted objects
        importedObjects - Objects that should be persisted
        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.
        entityInfo - entity info
        databaseObjectIds - database objects ids