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 Summary
Modifier and TypeMethodDescriptiongetAllNotSatisfiedDependencies
(ImportedObjectV2 importedObject) getDatabaseId
(Class<?> clazz, Object xmlId) Returns the database id related to the xml id or null if the database id was not generated before.boolean
isPersistedXmlId
(Class<?> clazz, Object xmlId) Check if the records with id from XML has been persisted.void
markObjectsAsPersisted
(ExportableEntityInfo entityInfo, List<Object> databaseObjectIds) Marks all ids as persisted.prepareObjectsToBePersisted
(ExportableEntityInfo entityInfo, Collection<ImportedObjectV2> importedObjects) Prepares records to be inserted to the database.
-
Method Details
-
getDatabaseId
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 objectsimportedObjects
- Objects that should be persisted- Returns:
- Returns objects which are ready to be persisted
-
isPersistedXmlId
Check if the records with id from XML has been persisted. -
markObjectsAsPersisted
Marks all ids as persisted. This method is usually called when the transaction is committed.- Parameters:
entityInfo
- entity infodatabaseObjectIds
- database objects ids
-
getAllNotSatisfiedDependencies
- Returns:
- all fields which referenced records are not persisted yet.
-