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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Collection<HibernateField>
getAllNotSatisfiedDependencies(ImportedObjectV2 importedObject)
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.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.Collection<ImportedObjectV2>
prepareObjectsToBePersisted(ExportableEntityInfo entityInfo, Collection<ImportedObjectV2> importedObjects)
Prepares records to be inserted 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.- Parameters:
entityInfo
- entity info of persisted objectsimportedObjects
- 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 infodatabaseObjectIds
- database objects ids
-
getAllNotSatisfiedDependencies
Collection<HibernateField> getAllNotSatisfiedDependencies(ImportedObjectV2 importedObject)
- Returns:
- all fields which referenced records are not persisted yet.
-
-